PL-400 Exam QuestionsBrowse all questions from this exam

PL-400 Exam - Question 222


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 Answer
Correct 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

?

Discussion

16 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 9, 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.

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!

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 17, 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

_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 17, 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

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 9, 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.

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 16, 2023

answers are correct

LSgeek
Jul 17, 2024

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