Change timezone for a Linux-based Azure WebApp
The time zone for a Windows-based Azure WebApp can be set using the
WEBSITE_TIME_ZONE app setting. If you try the same with a Linux-based WebApp you may find yourself in trouble.
For a Linux-based WebApp, you must use the app setting
TZ and the correct value can be found in the TZ database name column in this list.
If you did the mistake of adding the
WEBSITE_TIME_ZONE first, the
TZ app setting will not work, and the
WEBSITE_TIME_ZONE can not be deleted from the Azure Portal! (It looks like it can be deleted, but when the page is refreshed the setting is back.)
If you have made the mistake of adding the
WEBSITE_TIME_ZONE app setting to your Linux WebApp, you have two options.
- Delete and recreate the WebApp
- Use Azure CLI
I would recommend option number two. The following command can be used to delete the app setting.
az webapp config appsettings delete --name MyWebApp --resource-group MyResourceGroup --setting-names WEBSITE_TIME_ZONE