1

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?

Frank Boucher
  • 1,834
  • 20
  • 25
  • Changing timezone of a VM is typically frowned upon. Any specific reason you need to do this, vs normalizing to UTC and working w/local time through any type of UI? – David Makogon Aug 23 '18 at 15:42
  • Agreed with David. You should use UTC whenever possible. Even though you may be able to change it by logging into the VM, it will be reset any time you reset the VM. Why do you want to do this? Perhaps we can help better guide you if we can better understand what you are trying to accomplish. – Mehdi Ibrahim Aug 23 '18 at 15:51

1 Answers1

1

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.

Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575