The resource operation completed with terminal provisioning state 'Failed'.
Virtual Machine Status: Failed.
The Azure VM's provisioningState is showing as Failed, meaning the last control-plane operation accepted by Azure Resource Manager did not complete successfully. The VM may still be running and serving traffic, but the failed state will block further operations — such as resizing, replication, backup, or extension installation — until it is resolved. The most common triggers are a failed VM extension, an OS provisioning timeout, a failed deployment operation, or a transient platform-level issue.
The resource operation completed with terminal provisioning state 'Failed'.
Virtual Machine Status: Failed.
Why it happens
A VM extension (e.g., OmsAgentForLinux, CustomScript, VMSnapshot) failed to provision, putting the VM into a terminal failed state.
OS provisioning timed out (OSProvisioningTimedOut) — the guest OS did not complete setup within Azure's allotted time window, often due to a misconfigured or improperly generalised custom image.
A deployment or update operation (resize, reimage, configuration change) failed mid-execution after being accepted by Azure Resource Manager.
The Azure VM Guest Agent is unresponsive, outdated, or missing, preventing extensions from being applied and causing the provisioning state to get stuck.
A transient host-level issue or platform sync problem caused the VM's recorded state to diverge from its actual running state.
An allocation failure in the target region or availability set resulted in a failed provisioning state.
The VM was deployed from a custom VHD or image that was not correctly prepared (e.g., Sysprep not run on Windows, or waagent not deprovisioned on Linux).
How to fix it
Use Reapply first (Portal: VM > Support + troubleshooting > Redeploy + reapply > Reapply). This re-applies the VM's current configuration without moving it to a new host and is the least disruptive fix. Requires API version 2019-07-01 or later. CLI: `az vm reapply -g <ResourceGroup> -n <VMName>`. PowerShell: `Get-AzVM -ResourceGroupName <RG> -Name <VM> | Set-AzVM -Reapply | Update-AzVM`.
If Reapply does not resolve the state, check for failed VM extensions: Portal: VM > Settings > Extensions > Extensions status. Remove or reinstall any extension in a failed state. CLI: `az vm extension list -g <ResourceGroup> --vm-name <VMName>` then `az vm extension delete` on the failing one.
If the issue is OS provisioning timeout (OSProvisioningTimedOut): redeploy the VM to a new host node (Portal: VM > Support + troubleshooting > Redeploy + reapply > Redeploy). CLI: `az vm redeploy -g <ResourceGroup> -n <VMName>`. Redeployment moves the VM to a new host and may resolve platform-level sync issues.
Verify the Azure VM Guest Agent is running and up to date. On Windows: open services.msc inside the VM and check that 'Windows Azure VM Guest Agent' is running. On Linux: check `sudo systemctl status walinuxagent` or `waagent`. Restart the service if it is stopped.
If the VM was deployed from a custom image and shows OSProvisioningTimedOut: ensure the image was correctly generalised. For Windows, Sysprep must have been run with the OOBE and Generalise options selected before capturing. For Linux, run `sudo waagent -deprovision+user` before capturing the image.
If none of the above resolve the state, create a snapshot of the OS disk, use it to create a new managed disk, and deploy a new VM from that disk — preserving your data while getting a clean provisioning state.
Check the Azure Service Health dashboard for any active incidents in the VM's region that may be causing platform-level provisioning failures.
Review the Activity Log for the VM resource in the Azure portal to find the exact error code and message from the operation that caused the failed state.