Set Timezone on Azure Functions Application


In Azure functions you can set you a time zone for your application settings, doing so will mean when you use date functions the time will be based on your set-timezone rather than the Azure environments default timezone based on the location of the Azure functions servers.

How to set timezone in Azure Functions application


The following are the steps to set the timezone in Azure functions and verify that it is correct.

  1. Open your function app in the Azure portal and select your function app and then click on configuration
  2. Click new application setting
  3. A pop up will open, in the name field insert WEBSITE_TIME_ZONE, in the Value field insert the name of your local timezone as defined in Microsoft's Timezone documentation located at https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc749073(v=ws.10) alternatively you can find your local PC timezone.
  4. Click "Ok"
  5. Click "Save" at the top of the screen, this will save the application settings with your time zone.
  6. Microsoft is your should I update its configuration however you might like to restart the service just to make sure the settings take affect.


Verifying the timezone changes


You can confirm the settings have been applied by navigating to kudu tools 

  1. Navigate to "Advanced tools (kudu)" in your functions settings
  2.  From the debug console option in the top menu bar select command prompt
  3. Type time in the command window
  4. The correct time should be displayed for your selected timezone


Find your local computer timezone


If you are not sure what your exact time zone should be, you can get your computers local time zone by running a simple PowerShell command. This will only work on Windows based devices.

  1. Open PowerShell on your computer
  2. Type the command (timezone).id
  3. The timezone that is set on your local computer should then be displayed in the PowerShell window.

Was this helpful?

Yes No


Comments