PL-400 Exam QuestionsBrowse all questions from this exam

PL-400 Exam - Question 240


HOTSPOT -

You work for a multinational company that has Azure and Microsoft Dataverse environments in the United States (UTC-7) and Japan (UTC+9).

You create Azure Functions for each location to update key data.

You need to configure the functions to run at 4:00 AM on weekdays at each location.

Which schedule formats should you use? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

Exam PL-400 Question 240
Show Answer
Correct Answer:
Exam PL-400 Question 240

Box 1: 0 0 4 * * 1-5 -

Azure Functions uses the NCronTab library to interpret NCRONTAB expressions.

An NCRONTAB expression is similar to a CRON expression except that it includes an additional sixth field at the beginning to use for time precision in seconds:

{second} {minute} {hour} {day} {month} {day-of-week}

NCRONTAB time zones -

The numbers in a CRON expression refer to a time and date, not a time span. For example, a 5 in the hour field refers to 5:00 AM, not every 5 hours.

The default time zone used with the CRON expressions is Coordinated Universal Time (UTC).

To have your CRON expression based on another time zone, create an app setting for your function app named WEBSITE_TIME_ZONE.

1-5 is weekdays

Box 2: 0 0 4 * * 1-5 -

Reference:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer

?

Discussion

19 comments
Sign in to comment
mastaace
Feb 21, 2021

Since the question doesn't specify that an app setting has been created for the time zone, everything is UTC. Therefore, the answer should be US: 0011 ** 1-5, Japan: 0019 ** 0-4

tmc51
Feb 24, 2021

Gotta love a 50/50

yajof40649
Mar 27, 2021

The function must run on weekdes so it must be 1-5

Violoncello
Aug 10, 2022

1900 hours from Sunday to Thursday UTC translates to 0400 hours Monday to Friday in Japan.

Hendrikdb
Oct 26, 2021

there is only one way to determine weekday scheduling in CRON and that is 1 - 5. So the original answer is correct.

DeVries
Mar 12, 2022

I concur. Given answers implies WEBSITE_TIME_ZONE, which is not mentioned. US: 0 0 11 * * 1-5 (11:00 monday-friday UTC == 4:00 monday-friday US local time) Japan: 0 0 19 * * 0-4 (19:00 sunday-thursday UTC == 4:00 monday-friday Japan local time)

powerMaster
Mar 14, 2022

I am totally with you. As long as WEBSITE_TIME_ZONE is not set you need to concider that the function is in UTC!

Violoncello
Aug 10, 2022

1900 hours from Sunday to Thursday UTC translates to 0400 hours Monday to Friday in Japan.

Aby104
Jan 21, 2021

Answer is correct

Ming888
May 15, 2021

(UTC-7) US Mon 11am -7 hours = (UTC) Mon 4 AM 0 0 11 * * 1-5 (UTC+9) Japan Sun 7pm + 9 hours = (UTC) Mon 4 AM 0 0 19 * * 0-4

KenCraw
May 18, 2021

They way you laid it out finally makes sense , wish I could remove my old comment... I came at it from the opposite direction (I went the wrong direction in time)

ZVV
May 22, 2021

For days, the numeric values are 0 to 6 where 0 starts with Sunday. And Sundays definitely are not work(week)days. So this answer does not fit the requirement. SO I believe we need to believe they have WEBSITE_TIME_ZONE for sites

ZVV
May 22, 2021

Moreover - your calculations are just incorrect :) 9PM US = 4AM UTC = 1PM Japan

ZVV
May 22, 2021

Oh, sorry, my bad :( nevermind

ZVV
May 22, 2021

Oh, sorry, my bad :( nevermind

_WMC_
Jun 27, 2021

4:00 am US (UTC-7) = 1100 UTC 4:00 am JAPAN (UTC+9) = 1900 UTC *of the previous day* So assuming that there is *NOT* a WEBSITE_TIME_ZONE setting the correct answers for each would be: US: 0 0 11 * * 1-5 (4am Monday US is 11am Monday UTC) JAPAN 0 0 19 * * 0-4 (4am Monday Japan is 7pm Sunday UTC)

S41
Jul 22, 2021

1. Azure instance is available in both the locations - US and Japan 2. The functions should run only on weekdays The configuration should be 4 AM in US and 4 AM in Japan respectively on its Azure instances. Though in effect the functions will run at different times. No need of calculation then, (0 0 4 * * 1-5) seems right answer.

ETU69
Oct 16, 2021

This is the correct answer. (0 0 4 * * 1-5) for both, US and Japan Azure Instances. Both with the default time zone used with the CRON expressions.

fcisSara
Nov 2, 2021

Answer should be US: 0011 ** 1-5, Japan: 0019 ** 0-4

Mnarmeen
Mar 26, 2021

Can anyone please confirm the right answers?

Uiey
Jun 21, 2022

https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=in-process&pivots=programming-language-csharp

KenCraw
May 5, 2021

Environments in both places and set up for each location. Added to this that 4:00AM - 7 is 9PM (21), +9 is 1PM (13), since both 21 + 13 are not options in the hour section. I am inclined to go with given answers {second} {minute} {hour} {day} {month} {day-of-week}

KenCraw
May 18, 2021

Sorry everyone, had a mixup in logic... Please see Ming888's comment for clarity on answer + why

Uiey
Jun 21, 2022

The given answers are correct. https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=in-process&pivots=programming-language-csharp

DimpleG
Jan 27, 2023

For the US Azure Function, you should use 0 0 4 * * 1-5 to run the function at 4:00 AM every Monday through Friday. For the Japan Azure Function, you should use 0 0 4 * * 1-5 to run the function at 4:00 AM every Monday through Friday in Japan, which is 4:00 PM on Sunday UTC. You are correct that the schedule will be translated to 4 AM in UTC, but the schedule should be set according to the local time of each location.

ziggy1117
Aug 4, 2023

answers are correct!

FDC
Mar 30, 2021

I agree with mastaace should be US: 0011 ** 1-5, Japan: 0019 ** 0-4

luvasgloves
Sep 20, 2021

Is UTC or is the settings set? Tricky question.

Violoncello
Aug 10, 2022

This is indeed a tricky question. There are 2 clues: USA (UTC - 7) and Japan (UTC + 9). Or are they unnecessary bits of information? This question is therefore AMBIGUOUS.

DimpleG
Jan 27, 2023

For the US Azure Function, you should use 0 0 4 * * 1-5 to run the function at 4:00 AM every Monday through Friday. For the Japan Azure Function, you should use 0 0 4 * * 1-5 to run the function at 4:00 AM every Monday through Friday in Japan, which is 4:00 PM on Sunday UTC. You are correct that the schedule will be translated to 4 AM in UTC, but the schedule should be set according to the local time of each location.

jkaur
Aug 17, 2023

answers are correct

LSgeek
Jul 17, 2024

United State : 0 11 * * 1-5 Japan : 0 19 * * 1-5

Juan0414
Mar 6, 2025

https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=python-v2%2Cisolated-process%2Cnodejs-v4&pivots=programming-language-csharp#ncrontab-time-zones It does not mention anything about having a setting in the app for time zone. So UTC time must be used. For Japan the UTC time is 19 (Previous day) For US 11 (Same day) Weekdays start from sunday (0), so it should be 1-5 (But for Japan as it is 19 previous day it should 0-4) So, the answer is: 0 0 11 * * 1-5 0 0 19 * * 0-4

itmaxuser
Apr 14, 2025

The value 0-4 in the CRON expression would imply running the function on Sunday (0) through Thursday (4), not Monday to Friday (1-5). Here’s the breakdown of the day of the week mapping in CRON expressions: 0 = Sunday 1 = Monday 2 = Tuesday 3 = Wednesday 4 = Thursday 5 = Friday 6 = Saturday

itmaxuser
Apr 14, 2025

1. United States (UTC-7) For the United States (UTC-7), you want the function to run at 4:00 AM local time, so the time zone offset will be taken into account. The CRON expression for 4:00 AM on weekdays (Monday to Friday) in UTC-7 is: 0 0 11 * * 1-5 Explanation: 0 0: At 0 minutes and 0 seconds (exactly on the hour). 11: 4:00 AM UTC-7 is 11:00 AM UTC. * *: Every month and every day. 1-5: Monday to Friday. 2. Japan (UTC+9) For Japan (UTC+9), you want the function to run at 4:00 AM local time, and since Japan is UTC+9, you need to adjust the schedule accordingly. The CRON expression for 4:00 AM on weekdays (Monday to Friday) in UTC+9 is: 0 0 19 * * 1-5 Explanation: 0 0: At 0 minutes and 0 seconds (exactly on the hour). 19: 4:00 AM UTC+9 is 7:00 PM UTC. * *: Every month and every day. 1-5: Monday to Friday.