An Azure service that is used to provision Windows and Linux virtual machines.
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:
- 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
- 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.