Search code examples
azuretimezonevirtual-machineazure-devtest-labs

How to specify the Timezone of a VM in Azure Devtest Labs


Is there a way to specify the timezone of a VM?

Can I do something in the Devtest Lab ARM template, or in the formula?

Or

do I need to run a PowerShell script once the VM is up to do it?


Solution

  • Azure DevTest Labs has the concept of a custom artifact that you can use for such configuration tasks. I have created one that calls tzutil.exe to set the time zone from a drop-down list of the current valid Windows time zones.

    This has now been merged into the main Azure DevTest Labs repo as the windows-settimezone artifact, and is available here. You'll find that artifact in the Azure Portal when configuring your lab. You can also then view the generated ARM template if you like.

    After adding the repo, your setup will look like this in the Azure Portal:

    Screenshot

    Please note though, as others have pointed out, you should generally not change the time zone for servers. Leave that set to UTC and handle time zone conversions in your application code. Reserve using this artifact for setting the time zone on VMs intended for testing desktop client-side applications.