web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Azure: Schedule Azure Function in local time zone

AjitPatra Profile Picture AjitPatra 469

Recently, we were working on Timer triggered Azure functions. One of them was required to run at 2AM Australia time(UTC+10).

Azure Function uses 6 value CRON expression {second} {minute} {hour} {day} {month} {day-of-week}, not the regular one with 5 values.

So, we set the azure function timer with CRON expression “0 0 2 * * *”. By default, Azure function uses UTC for which the function started running at 12PM Australia time.

To fix this, we have 2 options:

  1. Manipulate the CRON expression so that it runs at 2AM Australia time i.e. “0 0 16 * * *”. This comes with an issue of further manipulating the CRON expression when the daylight savings kick off.
  2. Use app setting named WEBSITE_TIME_ZONE with the time zone as shown below:

Time zone value that we need to put can be found here https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc749073(v=ws.10)?redirectedfrom=MSDN.

Hope it helps !!


This was originally posted here.

Comments

*This post is locked for comments