DEV Community

Sedat SALMAN
Sedat SALMAN

Posted on Originally published at azurecloudinaminute.substack.com

Azure Deployment Failed? 12 Error Codes and How to Fix Each One

Prefer video? The full walkthrough is at the top of this post, and the most common cases have one-minute Shorts right where they come up. This guide first went out on the Azure Cloud in a Minute newsletter.

The one-minute answer

The problem: you deploy a VM, a storage account or a whole Bicep file, and Azure answers “Deployment failed” with a long block of JSON. Sometimes nothing was created. Sometimes half of it was.

How Azure decides: every deployment goes through Azure Resource Manager in three steps. Validation checks the file itself. Preflight checks the request against your subscription before anything is created: policies, permissions, sizes, quotas and names. Then the deployment runs, and each resource can still fail on its own.

Where to look first: the error code. It’s one word, such as SkuNotAvailable or RequestDisallowedByPolicy, and it names the cause more precisely than the message around it. Find the code, then go straight to that cause below.

The rest of this guide explains where each kind of error shows up, goes through the common codes grouped by what they mean, and ends with a checklist.

How a deployment fails

There are three kinds of error, and they show up in different places:

  • Validation errors come from the file: a typo in an expression, a missing bracket. A Bicep file with a syntax error doesn’t compile, so it never reaches Azure. Your editor catches these.
  • Preflight errors happen after you start the deployment but before anything is created, such as a parameter value that isn’t allowed. They appear in the resource group’s activity log, but not in its deployment history.
  • Deployment errors happen while resources are being created. They appear in both the deployment history and the activity log. Resources that were created before the failure stay where they are.

Using the portal doesn’t change this. When you click Create, the portal builds a template and deploys it, so a portal failure carries the same error codes.

Find the error code

In the portal: open the resource group → Settings → Deployments, select the failed deployment and open Error details. If the deployment isn’t listed, it failed in preflight: open the resource group’s Activity log instead and look for the failed operation.

With the Azure CLI: show the deployment’s error, then list the operations that failed.

az deployment group show --resource-group myRG --name myDeployment \
  --query properties.error
Enter fullscreen mode Exit fullscreen mode
az deployment operation group list --resource-group myRG --name myDeployment \
  --query "[?properties.provisioningState=='Failed']"
Enter fullscreen mode Exit fullscreen mode

The second command shows which resource failed and its status message, which holds the code.

The causes, one by one

They fall into four groups. The first two are preflight checks against your subscription. The third is the file. The fourth is something else already in the way.

Azure says no before it starts

1. RequestDisallowedByPolicy. An Azure Policy assignment blocks what you’re deploying, such as a public IP on a network interface, a region outside the allowed list or a missing tag. The error names the policy assignment and the policy definition, with their IDs.

Fix: read the rule, then change your deployment to meet it.

az policy definition show --name <definition-name>
Enter fullscreen mode Exit fullscreen mode

If you really need an exception, ask whoever owns the policy. Policy exemptions exist for this, but they are a governance decision, not something to work around.

2. RequestDisallowedByAzure. This one isn’t a policy you can see or change. It’s common on Azure for Students and similar subscriptions, and the message reads: “This policy maintains a set of best available regions where your subscription can deploy resources.”

Fix: deploy to a region your subscription allows. The message itself says to contact support if you need other regions.

3. AuthorizationFailed. Your account or service principal doesn’t have the permission it needs at that scope. To deploy a file, you need write access on every resource in it plus all operations on Microsoft.Resources/deployments. Deploying a VM, for example, needs Microsoft.Compute/virtualMachines/write and Microsoft.Resources/deployments/*. The error message names the action that was refused and the scope.

Fix: ask for a role that covers that action at that scope. Contributor on the resource group covers both. This error can also appear when a resource provider isn’t registered, which is the next cause.

4. MissingSubscriptionRegistration or NoRegisteredProviderFound. The subscription isn’t registered for the resource provider, such as Microsoft.Cdn. Deploying a Bicep file registers the providers defined in it, and the portal usually does the same, but supporting resources that aren’t in your file, such as monitoring or security resources, can need a provider you have to register yourself.

Fix: register the namespace named in the error. This needs the /register/action permission, which Contributor and Owner include.

az provider register --namespace Microsoft.Cdn
Enter fullscreen mode Exit fullscreen mode

There’s no room for it

5. SkuNotAvailable. The size you asked for isn’t offered in that region or zone for your subscription. The message says the requested size “is currently not available in location” with the location, zones and subscription. It also happens with Spot VMs when there’s no Spot capacity.

Fix: list the sizes with their restrictions. Without --all, the command hides restricted sizes, which is exactly what you want to see.

az vm list-skus --location eastus --size Standard_D --all --output table
Enter fullscreen mode Exit fullscreen mode

A restriction such as NotAvailableForSubscription confirms it. Pick another size, zone or region, or submit a SKU request to Azure Support if you need that one.

This one confuses people most when the quota is already approved, so here it is in under a minute:

6. OperationNotAllowed (quota). The deployment would take you over a quota. The message is specific: “Operation results in exceeding quota limits of Core. Maximum allowed: 4, Current in use: 4, Additional requested: 2.” For VMs, two limits apply at once: total regional vCPUs and the vCPUs for that VM family. Either one can stop you. Some quotas count resources per resource group instead, and those fail with ResourceQuotaExceeded.

Fix: check usage in that region, then request an increase: Subscriptions → your subscription → Usage + quotas → Request increase. Quotas are per region, so request it where you deploy.

az vm list-usage --location eastus --output table
Enter fullscreen mode Exit fullscreen mode

7. AllocationFailed or ZonalAllocationFailed. Your quota is fine and the size exists, but Azure doesn’t have capacity for it right now: “Allocation failed. We do not have sufficient capacity for the requested VM size in this region.” A related code, OverconstrainedAllocationRequest, means capacity may exist but not for every constraint you asked for at once, such as a zone plus accelerated networking plus a proximity placement group.

Fix: this is often temporary, so retry later. Otherwise try a different size or zone, or drop a constraint. For a planned large deployment, an on-demand capacity reservation holds capacity in advance.

The file is wrong

8. InvalidTemplate. The template failed validation. The usual reasons are an expression with a syntax mistake, a parameter value that isn’t in the template’s allowed values, or a circular dependency where resources wait on each other.

Fix: use VS Code with the Bicep extension, which flags syntax errors as you type. For allowed values, deploy with one of the values the template lists. For a circular dependency, remove dependsOn entries you don’t need. Bicep already adds a dependency when one resource references another.

9. ResourceNotFound or ParentResourceNotFound. Something in the file refers to a resource that doesn’t exist yet. Resource Manager creates resources in parallel when it can, so a web app can be created before the App Service plan it points to. It also happens when the resource lives in another resource group and the file doesn’t say so.

Fix: reference the other resource by its symbolic name, such as servicePlan.id, which makes Azure wait for it. For a resource that already exists, declare it with the existing keyword, and add scope: resourceGroup(rgname) if it’s in another resource group.

10. The name is taken or invalid. Storage account names must be 3 to 24 characters, use only lowercase letters and numbers, and be unique across all of Azure. AccountNameInvalid means the characters are wrong. StorageAccountAlreadyTaken means someone, anywhere, already has that name.

Fix: add a unique suffix. uniqueString returns 13 characters, so keep the prefix to 11 or fewer.

name: 'storage${uniqueString(resourceGroup().id)}'
Enter fullscreen mode Exit fullscreen mode

Something else is in the way

11. AnotherOperationInProgress, DeploymentActiveAndUneditable or Conflict. Another operation is running on the same resource, or another deployment is running in the same resource group. Conflict can also mean the resource isn’t in a state that allows the change. Microsoft’s example is a disk resize that’s only allowed when the VM is created or deallocated.

Fix: wait for the other operation to finish, then retry. For a state conflict, put the resource in the state the change needs, such as deallocating the VM first.

12. DeploymentQuotaExceeded. A resource group keeps up to 800 deployments in its history. Azure deletes old entries automatically once the history passes 700, down to 600. Two things stop that cleanup: a CanNotDelete lock on the resource group or subscription, and a deploying account without Microsoft.Resources/deployments/delete permission.

Fix: remove the lock or grant the permission so the cleanup can run, or delete old entries yourself. Deleting a history entry doesn’t touch the resources it deployed.

az deployment group delete --resource-group myRG --name oldDeployment
Enter fullscreen mode Exit fullscreen mode

How to check it

1. Get the exact code. Deployments → Error details, or the activity log for preflight failures.

2. Find the failed resource. List the failed operations, as above. A long deployment can fail on one resource out of fifty.

3. Match the code to a cause above. Most fixes follow directly from the code.

4. Check sizes and quota before redeploying VMs. Run az vm list-skus --all and az vm list-usage for the target region.

5. Test without creating anything. Validate runs the preflight checks against your subscription. What-if shows what the deployment would create, change or delete.

az deployment group validate --resource-group myRG --template-file main.bicep
az deployment group what-if --resource-group myRG --template-file main.bicep
Enter fullscreen mode Exit fullscreen mode

6. Redeploy. Resources that succeeded the first time are already there. If you reuse the same deployment name, the new run replaces the old entry in the history.

Checklist

  1. You have the exact error code, not just “Deployment failed”.
  2. You know which resource failed, from the failed operations list.
  3. No policy assignment denies it, or you’ve changed the deployment to meet the policy.
  4. The region is one your subscription allows.
  5. Your account can write the resources and Microsoft.Resources/deployments.
  6. The resource providers it needs are registered.
  7. The VM size isn’t restricted for your subscription in that region and zone.
  8. Regional vCPU quota and VM family quota both cover it.
  9. The file validates, with allowed parameter values and no circular dependencies.
  10. References to other resources use symbolic names, or existing with the right scope.
  11. Globally unique names have a unique suffix.
  12. No other operation or deployment is running on the same resource or resource group.
  13. The deployment history has room, with no lock blocking the cleanup.

From the field

Two public threads on Microsoft Q&A this year show the two codes that confuse people most.

Quota approved, size still not available. In April 2026, a user had 65 vCPUs of approved quota in East US, but the portal showed “Size not available” for the Bsv2, Easv5 and Easv6 sizes, and deployments failed. Support had confirmed the quota was fine. An MVP’s reply named the real issue: regional capacity, not quota. A quota is permission to use vCPUs. It doesn’t guarantee that a size is offered to your subscription, or has capacity, in that region. Microsoft’s moderator asked for az vm list-skus --all output and its Restrictions column, where NotAvailableForSubscription would confirm it, and suggested checking each zone and trying East US 2 or Central US. (thread)

Student subscriptions and regions. In March and June 2026, Azure for Students users got RequestDisallowedByAzure when creating resources, including a Microsoft Foundry resource. The accepted answers explained that these subscriptions are usually limited to about five regions that vary from one subscription to another, and showed where to look: Azure Policy → Authoring → Assignments, the assignment named “Allowed resource deployment regions”, and its Allowed locations parameter. Other replies were more cautious. A Microsoft reply in June said there’s no direct list of allowed regions for these subscriptions, a reply in March suggested trying the regions the portal offers during creation, and both pointed to a Pay-As-You-Go subscription (or, in June, an institutional one) when the service isn’t available in any allowed region. (March thread, June thread)

In both cases the error code was the answer. The message around it was what sent people the wrong way.

Keep going

Related guides:

Shorts from this guide: RequestDisallowedByPolicy names the policy, quota approved but the VM size isn't available.

Get the next one: new guides go out first on the Azure Cloud in a Minute newsletter, with a long video and Shorts on YouTube. I also run AWS Cloud in a Minute and Kubernetes in a Minute.

Sources

From Microsoft Learn:

Field cases from Microsoft Q&A, linked above.

Independent writer, not affiliated with or endorsed by Microsoft.

Top comments (0)