ARM and Bicep deployment errors — template, dependency and state

Look up an error from a Bicep or ARM deployment itself — DeploymentFailed and the real error under it, InvalidTemplate, segment mismatches, NotFound and ParentResourceNotFound from missing dependencies, circular dependencies, concurrent operations, PropertyChangeNotAllowed, InUseSubnetCannotBeDeleted, the 800-deployment and job-size limits, and complete-mode cleanup — with cause, check and fix.

markdownreferencev1XADB-BPH0stage: operatetrust: officialservice: arminterface: iacinterface: cliDeploymentFailedInvalidTemplateInvalidTemplateDeploymentDeployment template validation failedMismatchingResourceSegmentsNotFound Cannot findResourceNotFoundParentResourceNotFoundParent resource not foundInvalidTemplateCircularDependencyTemplateResourceCircularDependencyInvalidResourceReferenceLinkedInvalidPropertyIdDeploymentActiveAndUneditableAnotherOperationInProgressConflictPropertyChangeNotAllowedInUseSubnetCannotBeDeletedDeploymentQuotaExceeded800 deploymentsDeploymentJobSizeExceededJobSizeExceededInvalidDeploymentLocationInvalidContentLinkDeploymentFailedCleanUpDeploymentNameLengthLimitExceededInvalidParameterIf-Match precondition failed

Created 21 Oct 2026 · Modified 23 Oct 2026 · 1 version

DeploymentFailed is never the answer; it wraps the failing operation's own code. Get that code first (guides/arm/debug-failed-deployment.md), then look it up here or in reference/arm/errors.md (subscription, quota, SKU, region).

Where the error appears tells you its type:

  • Compile: bicep build prints BCP… codes with line and column (reference/bicep/compile-errors.md).
  • Validation and preflight: the command fails before anything deploys, often as InvalidTemplateDeployment wrapping the real reason. These errors appear in the Activity log, not in deployment history.
  • Deployment: a resource operation failed. These appear in deployment history and in az deployment operation group list.

Template and validation

ErrorCause → fixCheck
InvalidTemplate Deployment template validation failedA syntax or expression error, an invalid parameter value, or a circular dependency. The message varies with the causebicep build main.bicep; az deployment group validate -g <rg> --template-file main.bicep
InvalidTemplate about type and name segments (MismatchingResourceSegments)The name has a different number of / segments than the type: Microsoft.KeyVault/vaults/secrets needs vault/secret. In Bicep, use parent: and give the child a one-segment nameCount segments in type and name
InvalidTemplateDeploymentPreflight rejected a resource: the inner message holds the real reason (SKU not available, a policy, a quota)The inner message
InvalidParameter, InvalidRequestContentA value the provider refuses (weak password, bad name) or an unknown or missing property. The message names itThe resource's API reference for that API version
PasswordTooLongOften a password converted to a secure string before being passed to a @secure() parameter: pass the plain value—
InvalidContentLinkA linked template URI that isn't reachable (private storage without a SAS)curl -I <uri>
DeploymentNameInvalidCharacters / DeploymentNameLengthLimitExceededDeployment names: letters, digits, -, ., _; at most 64 charactersThe --name you passed
InvalidDeploymentLocationA subscription-scope deployment name was reused with a different --location. Use a new name or the same locationaz deployment sub show --name <n> --query location
DeploymentJobSizeExceeded / JobSizeExceededThe deployment job is over 1 MB compressed (template plus metadata), the template over 4 MB, or one resource over 1 MB, after loops expand. Remove unneeded dependsOn (loop-to-loop dependencies grow as n²), move large data out, split into modulesbicep build output size

Dependencies and references

ErrorCause → fixCheck
NotFound Cannot find ServerFarm with name <plan>.Parent and dependent were deployed in parallel because nothing linked them. In Bicep, reference the other resource by symbolic name (serverFarmId: plan.id) to create the dependency; resourceId() strings create noneDoes the dependent use the symbol or a string ID?
ResourceNotFound The Resource '<type>/<name>' under resource group <rg> was not found.existing or reference() points at something missing, in another group or subscription without scope:, or not created yetaz resource show --ids <id>
ParentResourceNotFound Can not perform requested operation on nested resource. Parent resource '<name>' not found.The child started before its parent, or names a parent that doesn't exist. Use parent: <symbol>az resource show on the parent
InvalidTemplateCircularDependency, TemplateResourceCircularDependencyTwo resources depend on each other. Remove explicit dependsOn you don't need: Bicep infers thembicep build warnings no-unnecessary-dependson
InvalidResourceReference, LinkedInvalidPropertyIdA resource ID that didn't resolve: a missing subscription, group, parent or name segmentPrint the ID expression's value as an output

State and concurrency

ErrorCause → fixCheck
DeploymentActiveAndUneditableAnother deployment with that name is running in the group. Wait, or use a unique nameaz deployment group list -g <rg> --query "[?properties.provisioningState=='Running'].name"
AnotherOperationInProgress; The specified precondition 'If-Match = …' failed.Two operations on the same resource at once (two pipelines, a portal edit, or missing dependencies in one template). Serialize; retryThe Activity log for the resource
ConflictThe operation isn't allowed in the resource's current state (for example, resizing a disk on a running VM)The resource's provisioningState and power state
PropertyChangeNotAllowedThe property can't be changed on a deployed resource. Change only permitted properties, or create a new resourceThe provider's API reference for that property
InUseSubnetCannotBeDeletedAn update that deletes and re-creates part of a resource, typically a VNet redeployed without its subnets: incremental mode reapplies every property, so omitted values are removed (the hub's reading of the two Microsoft pages). Declare subnets in the VNet's subnets property, not as separate child resources, and specify all unchanged valuesCompare the template's subnets with az network vnet subnet list
DeploymentQuotaExceeded800 deployments per resource group. Resource Manager auto-deletes near the limit unless a CanNotDelete lock blocks it, you opted out, or many run at once. az deployment group delete -g <rg> -n <old>az deployment group list -g <rg> --query "length(@)"
DeploymentFailedCleanUpComplete mode couldn't delete resources missing from the template (no permission). Microsoft is deprecating complete mode: use deployment stacks for deletionsreference/arm/deployment-stacks.md

When none of these fits

Re-run with --debug, or set the deployment's debugSetting.detailLevel to requestContent,responseContent. That logs the request and response of each operation, secrets included, so use it once and then turn it off. Then read the failing operation's statusMessage in full.

Read this document as markdown — the same bytes an agent receives.