exam questions

Exam PL-400 All Questions

View all questions & answers for the PL-400 exam

Exam PL-400 topic 6 question 2 discussion

Actual exam question from Microsoft's PL-400
Question #: 2
Topic #: 6
[All PL-400 Questions]

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:

Show Suggested Answer Hide Answer
Suggested Answer:
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
?

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
mastaace
Highly Voted 4 years, 1 month ago
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
upvoted 42 times
tmc51
4 years, 1 month ago
Gotta love a 50/50
upvoted 11 times
...
yajof40649
4 years ago
The function must run on weekdes so it must be 1-5
upvoted 5 times
Violoncello
2 years, 8 months ago
1900 hours from Sunday to Thursday UTC translates to 0400 hours Monday to Friday in Japan.
upvoted 6 times
...
...
Hendrikdb
3 years, 5 months ago
there is only one way to determine weekday scheduling in CRON and that is 1 - 5. So the original answer is correct.
upvoted 3 times
...
powerMaster
3 years, 1 month ago
I am totally with you. As long as WEBSITE_TIME_ZONE is not set you need to concider that the function is in UTC!
upvoted 1 times
...
...
Aby104
Highly Voted 4 years, 2 months ago
Answer is correct
upvoted 19 times
...
itmaxuser
Most Recent 5 days, 19 hours ago
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.
upvoted 1 times
...
itmaxuser
5 days, 19 hours ago
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
upvoted 1 times
...
Juan0414
1 month, 2 weeks ago
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
upvoted 1 times
...
LSgeek
9 months, 1 week ago
United State : 0 11 * * 1-5 Japan : 0 19 * * 1-5
upvoted 1 times
...
jkaur
1 year, 8 months ago
answers are correct
upvoted 1 times
...
ziggy1117
1 year, 8 months ago
answers are correct!
upvoted 2 times
...
DimpleG
2 years, 2 months ago
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.
upvoted 2 times
...
DimpleG
2 years, 2 months ago
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.
upvoted 1 times
...
Uiey
2 years, 10 months ago
The given answers are correct. https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=in-process&pivots=programming-language-csharp
upvoted 2 times
...
fcisSara
3 years, 5 months ago
Answer should be US: 0011 ** 1-5, Japan: 0019 ** 0-4
upvoted 5 times
...
luvasgloves
3 years, 7 months ago
Is UTC or is the settings set? Tricky question.
upvoted 1 times
Violoncello
2 years, 8 months ago
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.
upvoted 2 times
...
...
S41
3 years, 9 months ago
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.
upvoted 6 times
ETU69
3 years, 6 months ago
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.
upvoted 4 times
...
...
_WMC_
3 years, 9 months ago
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)
upvoted 9 times
...
Ming888
3 years, 11 months ago
(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
upvoted 14 times
KenCraw
3 years, 11 months ago
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)
upvoted 1 times
...
ZVV
3 years, 11 months ago
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
upvoted 1 times
...
ZVV
3 years, 11 months ago
Moreover - your calculations are just incorrect :) 9PM US = 4AM UTC = 1PM Japan
upvoted 1 times
ZVV
3 years, 11 months ago
Oh, sorry, my bad :( nevermind
upvoted 1 times
...
...
...
KenCraw
3 years, 11 months ago
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}
upvoted 3 times
KenCraw
3 years, 11 months ago
Sorry everyone, had a mixup in logic... Please see Ming888's comment for clarity on answer + why
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago