Hello, @Nima Azimzadeh !
Why am I getting the following errors when creating a VM?
When creating a VM in Azure the operation failed: "The resource write operation failed to complete successfully, because it reached terminal provisioning state "Failed". (Code: ResourceDeploymentFailure)
This error by itself has a wide variety of possible causes. @Stuart Dobson has recommended looking at the JSON tab for more information to help with troubleshooting:
I have found you're able to get more details by going to the Deployments tab in Azure, clicking on the failed deployment, Related Events, Expand the Operation, find the one that failed and then, this is the important bit, look at the Json tab. I've found that there is usually more added to the message than is shown further up the chain.
Without looking at additional information, some possible causes for this error include:
- Outdated or incomplete JSON/ARM template: The ARM template you are using for deployment may be missing key fields.
- Incompatible configuration values: If you are not creating the VM using the portal, it is possible to include incompatible configuration values (size/storage options, Trusted Launch limitations, etc.). Try creating the VM using the same values in the portal to see if it triggers a warning.
- Azure Policy: An Azure Policy may prevent a required action from completing to create the VM.
That you aren't able to delete the resources that have been created makes me think there may be something related to a policy or possibly a role restriction. If that's not the case, then we'll need to investigate this further by looking at the resources. If you would like us to do that, please email the following to AzCommunity@microsoft.com and we'll get back to you promptly:
- Subject: "Attn: kobulloc - Unable to create VM or delete resources"
- Email body: Your Subscription ID
- Email body: A link to this thread so we can validate and expedite the request
If you don't receive a response within 24 hours, please reply to the thread so we can investigate.
I hope this has been helpful! Your feedback is important so please take a moment to accept answers.
If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!