Share via

Azure VM Image Builder: DeploymentScriptExceededMaxAllowedTime

Sophia Susanto 0 Reputation points Microsoft Employee
2026-03-03T18:33:36.03+00:00

Hello Team,

There were no changes made to the deployment script and it successfully completed on 11/21/2025. However, we are running the Build ACG Image now and it seems to keep timing out. It timedout the last 3 times. We need to be able to run Build ACG Image in order to fulfill an S360 item.

We first noticed this error on 2/18.

Error: {     "status": "canceled",     "error": {         "code": "DeploymentScriptExceededMaxAllowedTime"     } }

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Jilakara Hemalatha 10,200 Reputation points Microsoft External Staff Moderator
    2026-03-03T19:18:49+00:00

    Hello Sophia Susanto

    Thank you for reaching out Q/A. Based on the error "code": "DeploymentScriptExceededMaxAllowedTime"

    This indicates that the deployment script executed as part of the Azure VM Image Builder build process exceeded the maximum allowed execution time and was automatically canceled by the platform.

    Azure VM Image Builder uses an Azure Deployment Script resource to orchestrate the temporary build VM, run customization steps, and distribute the image to Azure Compute Gallery. If any phase of this process (customization, updates, software installation, or image distribution/replication) takes longer than the configured timeout, the build will terminate with this error.

    Since the same deployment completed successfully on 11/21/2025 and began failing around 2/18 without any script changes, this behavior is most commonly associated with runtime conditions rather than template misconfiguration.

    By default, the Deployment Script resource has a limited execution window. If the script does not complete within that duration, Azure automatically cancels it and returns the DeploymentScriptExceededMaxAllowedTime error.

    Please find the below recommendations:

    1. Increase the Image Builder Build Timeout:

    By default, the build timeout is 240 minutes. If your build is taking longer, increase it in your image template:

    "properties": {
      "buildTimeoutInMinutes": 360
    }
    

    Reference: Create an Azure Image Builder Bicep or ARM template JSON template

    Troubleshoot Azure VM Image Builder

    2.Increase Deployment Script Timeout (If Applicable)

    If you are using an ARM/Bicep deploymentScript resource, explicitly define the timeout value to prevent the container from stopping early:

    "timeout": "PT2H"

    You may increase this further if needed, within supported limits.

    Reference: Use deployment scripts in Azure Resource Manager templates

    1. If Windows Update customization is enabled, temporarily disable it and test the build. Update installation is a common cause of extended execution time.

    Additional diagnostic details can be found in the staging resource group created by VM Image Builder. Please review the following files: customization.log and executionresult.json

    These logs will help identify the exact step where the execution time increases or stalls.

    Hope this helps! Please let me know if you have any queries.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.