When deploying a custom script extension for a VM in Azure, it times out after 15 minutes. The timeout block is set to 2hrs. I cannot figure out why it keeps timing out. Could anyone point me in the right direction please? Thanks.
Resource to deploy (https://i.stack.imgur.com/lIfKj.png)
2
Answers
I resolved the issue by changing the type_handler_version to 1.9.
In Azure, each resource will take a particular amount of time for provisioning. For Virtual Network Gateway’s/ Virtual machines, timeout is up to 2 hours as mentioned in terraform timeouts.
Therefore, the
timeout
block we provide for any virtual machine has to be less than two hours (2h).I tried creating a replica for
azure vm extension
resource by using below terraform code and it deployed successfully.timeout
block:azure_VM_extension:
Created a virtual machine by adding required configurations under resource group.
main.tf:
Executed:
terraform init
:terraform plan
:terraform apply
:Extension added successfully after deployment:
You can upgrade status if you want to use extensions.