Use it to deploy Azure resources repeatably, review changes before they happen, and explain what a past deployment did.
ARM Templates and Bicep
ARM templates (JSON) and Bicep (a simpler language that compiles to ARM JSON) declare Azure resources. Azure Resource Manager deploys them at resource group, subscription, management group or tenant scope; what-if previews the changes first.
1. Which scope and target (resource group, subscription)?
2. What does what-if say will change — and is any Delete or Modify unexpected?
3. Did the deployment fail at validation or at a specific resource operation?
4. Did drift happen outside the template since the last deployment?
Bicep/ARM source → build/lint → validation (template, policy, RBAC) → what-if → deployment at a scope → resource operations → deployment history
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
az deployment operation group list -g $RG -n main-20261129 \Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Read-only Verification Verify boundary
RG=rg-web-prod
# Compile and lint locally
az bicep build --file main.bicep
az bicep lint --file main.bicep
# Preview changes against the live resource group
az deployment group what-if -g $RG --template-file main.bicep --parameters prod.bicepparam
# Deploy only after confirming the preview interactively
az deployment group create -g $RG --template-file main.bicep --parameters prod.bicepparam --confirm-with-what-if
# History: what was deployed here, and did it succeed?
az deployment group list -g $RG --query "[].{name:name, state:properties.provisioningState, time:properties.timestamp, mode:properties.mode}" -o table
# Per-resource operations of one deployment (find the failing resource)
az deployment operation group list -g $RG -n main-20261129 \
--query "[].{resource:properties.targetResource.resourceName, op:properties.provisioningOperation, state:properties.provisioningState, code:properties.statusMessage.error.code}" -o table
Step 2 Common mistakes Narrow the fault
- Running complete mode against a shared resource group and deleting resources another team deployed.
- Templates that describe only the property being changed, so incremental redeploys reset everything else.
- Skipping what-if because "it's only a parameter change".
- Passing secrets as plain parameters instead of
@secure()parameters or Key Vault references. - Mixing portal changes and IaC on the same resources without detecting drift.
Step 3 Troubleshooting Narrow the fault
InvalidTemplate / validation errors. Fix syntax, types or missing parameters; az bicep build and lint catch most before Azure does.
RequestDisallowedByPolicy. An Azure Policy assignment denies the resource as defined; the error names the policy. Change the template or request an exemption — do not disable the policy.
AuthorizationFailed. The deploying identity lacks permission at the target scope, often for role assignments (Microsoft.Authorization/roleAssignments/write).
Deployment succeeded but a setting reverted. Someone changed the resource manually (drift) and the template redeployed its own version — or the template omitted a property that incremental mode reset. Compare with what-if before the next run.
Resource not deleted when removed from the template. Expected in incremental mode; use a deployment stack (or delete deliberately) instead of switching to complete mode.
Incremental mode (default) creates or updates what is in the template and leaves other resources alone — but resets omitted properties of resources it does define. Complete mode deletes resources not in the template; it is being deprecated in favour of deployment stacks. Always run what-if before deploying to production.
az deployment group what-if— preview create/modify/delete.az deployment group list— deployment history and state.az deployment operation group list— per-resource result of one deployment.az bicep build— compile and lint locally.
ReferenceWhat it is2 sections · depth on demand
Direct Answer
Azure Resource Manager (ARM) is the API every Azure change goes through. ARM templates describe resources declaratively in JSON; Bicep is a shorter, typed language that compiles to the same JSON, so anything ARM can deploy, Bicep can describe.
You deploy a template to a scope: a resource group (az deployment group create), a subscription (az deployment sub), a management group (az deployment mg) or the tenant (az deployment tenant).
Before deploying, what-if shows what would be created (+), deleted (-), modified (~) or redeployed (!) without changing anything. In the default incremental mode, resources not in the template are left untouched.
Scope and canonical references
This Topic covers Azure's native IaC. Neighbouring Topics:
- Multi-cloud IaC: Terraform / OpenTofu in Automation.
- Policies and RBAC that a deployment must pass: Azure Governance.
- The resource hierarchy deployments target: Microsoft Azure.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Deployment modes
| Mode | Resources in template | Resources in the group but not in the template |
|---|---|---|
| Incremental (default) | Created or updated | Left unchanged |
| Complete | Created or updated | Deleted |
Two details cause most surprises:
- In incremental mode, redeploying a resource reapplies all its properties; properties you omit are reset to defaults. The template must describe the resource's full desired state, not just the setting you wanted to change.
- Complete mode is supported only for root-level, resource-group deployments, never deletes in locked resource groups, and also deletes resources whose
conditionevaluates to false. Microsoft states complete mode is not recommended and will be gradually deprecated; use deployment stacks to manage deletion of resources that leave the template.
What-if
Change types: Create, Delete (only in complete mode), Modify, NoChange, Ignore, NoEffect (read-only properties) and Deploy (redeploy where property changes cannot be predicted, with ResourceIdOnly output). Known limitations: resources deployed through templateLink (including template specs in nested deployments) are not expanded, expressions such as newGuid(), utcNow(), reference() and listKeys() are not evaluated, and properties set by default at deployment can appear as deletions. Treat what-if as a strong review aid, not as proof.
Bicep essentials: modules for reuse, param/var/output, existing to reference resources without deploying them, @secure() for parameters that must not be logged, and az bicep build/lint in CI.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Deep reference
Healthy vs suspicious evidence
Output interpretation
What-if output groups changes per resource:
+ Create— new resources; check names, SKUs and regions.~ Modifywith property lines — read each line;-before a property means it will be removed or reset. An unexpected reset (for example network rules or tags) usually means the template does not describe the full state of that resource.- Delete— appears only in complete mode; stop and confirm every one.= NoChange,* Ignore,x NoEffect— no action.
The summary line (Resource changes: 1 to create, 2 to modify) is a quick sanity check before reading details. A warning that the output may contain false positives appears when expressions could not be evaluated.
Deployment list: Failed deployments keep their name and timestamp; the operation list shows which resource failed and its error code. Succeeded with mode Complete deserves a look at whether anything was deleted.
Design & tradeoffs
Design decisions
Bicep vs Terraform. Bicep has day-zero support for new Azure features, no state file, and native what-if; Terraform/OpenTofu covers multiple clouds and SaaS providers with one workflow but needs state management. Many organizations use one per platform rather than both on the same resources.
Scope design. Deploy platform resources (management groups, policies, networking hubs) at management group or subscription scope from a platform pipeline; deploy application resources at resource-group scope from the application's pipeline.
Deletion. Prefer incremental mode plus deployment stacks with deny settings over complete mode.
Pipelines. Lint and build on every change, post what-if output to the pull request for review, and deploy with a workload identity rather than stored credentials.