Timeout using Azure Deployment Environments to create VM (DeploymentCanceledByTimeout)

266 Views Asked by At

As the only step in this deployment I am creating a VM from an Image Template.

Error details
DeploymentCanceledByTimeout
The timeout for the deployment was reached, and the deployment was canceled.

These times are very consistent over multiple tests.

  • 0:40 the resources group has been created and is visible in the portal
  • 1:15 VM is visible in the portal and it's state is Creating
  • 11:15 timeout occurs in devportal
  • 11:45 VM is Running

location: eastus2
osDiskType: Premium_LRS
virtualMachineSize: Standard_B4ms
OS: Win11

Is this a per object timeout or a timeout for creating the environment?
How do I increase this timeout?
Where is there documentation about this timeout?
Is there a way to execute the ARM templates asynchronously?

https://github.com/Azure/deployment-environments/issues/23

1

There are 1 best solutions below

2
Jahnavi On

Error details
DeploymentCanceledByTimeout
The timeout for the deployment was reached, and the deployment was canceled: -

The timeout could be caused by a per-object timeout or a timeout during the environment creation process.

Below are the few workarounds I found for your issue.

  1. You can use a custom deployment script with "timeout": "PT30M" flag in ARM as detailed in this MSDoc. This parameter's value should be greater than the time it takes to create the environment. Or you can also add the deploymentTimeoutInSeconds parameter to the deployment template directly if it permits.

  2. As I mentioned in the comments, it is not possible to execute the ARM templates asynchronously. These are built in synchronous, and the deployment process will move to the next resource only if the prior resource deployment has completed.

But in order to achieve it temporarily, you can use --no wait argument while deploying the template with az deployment group create command.

I tried to deploy a VM windows image using Arm template by referring to github template and the deployment was successful as shown.

enter image description here

enter image description here