Pcornel
Browse topics
Options
Recent
Favorites
Cloud · Technical reference

ARM Templates and Bicep

Direct answer

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.

When to use this

Use it to deploy Azure resources repeatably, review changes before they happen, and explain what a past deployment did.

First 30 seconds

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?

Operational verification

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
Platform / version applicability
Azure Resource Manager and Bicep. Multi-cloud IaC (Terraform/OpenTofu) is in Automation.
Applicability is projected only from persisted Topic profile and Command metadata.
At a glance

Operational reference

Fast context before you go deeper.

PlatformAzure Resource Manager and Bicep. Multi-cloud IaC (Terraform/OpenTofu) is in Automation.
Key commandaz deployment operation group list -g $RG -n main-20261129 \
Scope / prerequisiteUse it to deploy Azure resources repeatably, review changes before they happen, and explain what a past deployment did.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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.

Key points

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.

Key checks
  • 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceImportant terms & boundaries1 section · depth on demand

In depth

Deployment modes

ModeResources in templateResources in the group but not in the template
Incremental (default)Created or updatedLeft unchanged
CompleteCreated or updatedDeleted

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 condition evaluates 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
Terminology layer

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.

Aliases that resolve here
arm templateazure resource manager templatewhat-ifaz deploymentdeployment stackscomplete mode
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

What-if output groups changes per resource:

  • + Create — new resources; check names, SKUs and regions.
  • ~ Modify with 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.

Confirmation

Confirm action

Continue?