How to set the time zone of linux machines for azure vms

I was able to set the time zone for windows machine with the help of os_profile_windows_config but in linux under os_profile_linux_config i do not see any timezone variable.

please let me know what is the best way to acheive this.

Hi @sunnynazar!

Unfortunately this is more a Linux and/or Azure question than a Terraform question, so there might not be anyone in this forum who knows the answer. (You might be lucky, though!)

It may be more fruitful to ask this question in an Azure-specific forum to see if there is an Azure-specific mechanism for setting timezone on a Linux machine.

However, I suspect that Azure is expecting you to configure the system timezone in a way that is specific to the Linux distribution image you are using, since these details can vary from one distribution to another. If you can find out how to set the timezone for the Linux distribution you are using, and if your Linux system image includes cloud-init, then you could set the custom_data argument on your virtual machine resource to instruct cloud-init to run the appropriate commands to set the timezone during the boot process.

Thanks, seems this is the only way to do it.

I will use custom data parameter to achieve this.

Sunny Nazar