Changing the timezone on your Azure Webapp / App Service / Function

 

Issue

With one of my flows, I was using an Azure function to generate a filename for my Azure logic app. This name was generated based on the date…

2017-01-24-20_10_33-application-settings-microsoft-azure

What did I see happening…2017-01-24-20_11_20-scoreboard-microsoft-azure

As I the script ran just after midnight, I saw that I was getting the day before instead of the actual date.

 

The Cause

By default, the Azure App Service / Webapp / Functions are running in UTC/GMT. Though I configured my logic apps to use the timezone “CET” (UTC/GMT+1)

2017-01-24-20_11_43

When checking with “kudu”,  I saw I had a mismatch on my hand…

 

The Fix

Apparently there is an easy fix! So let’s try that one… Via the registry I checked for the official windows name for my time zone, being the “Std”-value (“W.Europe Standard Time”).

2017-01-24-20_14_44-registry-editor

I went to the “Function app settings”

2017-01-24-20_14_56-function-app-microsoft-azure

And selected “Application settings” on that page
2017-01-24-20_15_21-kvaesnhl-microsoft-azure

Here I added an app setting called “WEBSITE_TIME_ZONE”, where I entered my time zone (std-value).

2017-01-24-20_15_50-application-settings-microsoft-azure

Press save and … wait for it.

2017-01-24-20_16_06-nvidia-geforce-overlay

Afterwards, all was okay!

2017-01-24-20_16_54

5 thoughts on “Changing the timezone on your Azure Webapp / App Service / Function

  1. Hi. I follow your instructions and work fine. Thanks!
    But i have a question… because, although now if a function do Date.Now inside it, will return the correct date and time, but on the registry console still appears a wrong date.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.