Azure Function based on Web app sandbox. Web app need you to set the timezone in env settings first. The timetrigger attribute is the declaration part of the function. The environment variables will be checked here. If you do not set the environment variables about the time zone in advance, it will be processed according to the default UTC time.

The env variable comes from different place when run on local and run on azure.

For example, if you want to set EST time.

On local, you need to set it in local.settings.json. like this:

    "IsEncrypted": false,
    "Values": {
      "AzureWebJobsStorage": "UseDevelopmentStorage=true",
      "WEBSITE_TIME_ZONE": "Pacific Standard Time"

On Azure, set the time zone in this place(dont forget to save the changes):

enter image description here
enter image description here


Last modified: May 26, 2021



Write a Reply or Comment