Domain 3 of 5 · Chapter 1 of 4

ARM Templates and Bicep

Unlock the complete study guide + 1,040 practice questions across 16 full exams.

Bundled into the existing Microsoft Azure Administrator premium course — no separate purchase.

Included in this chapter:

  • Template anatomy: the four sections you read and edit
  • Dependencies: implicit references vs explicit dependsOn
  • Deployment scopes and modes: where it lands and what gets deleted
  • Deploying, exporting, and converting between ARM and Bicep

ARM JSON template vs Bicep file

DimensionARM JSON templateBicep file
File / extensionJSON (.json)Bicep DSL (.bicep)
Required boilerplate$schema and contentVersion requiredNone, declarations only
Parameters / variablesparameters and variables objectsparam and var keywords
Resource referenceresourceId() / reference() functionssymbolic name (e.g. stg.id)
Dependency orderingimplicit via reference(), or explicit dependsOnimplicit via symbolic name; explicit dependsOn rarely needed
Relationship to enginefed directly to ARMtranspiled to ARM JSON, then fed to ARM
Convert to the otherbicep decompile / az bicep decompilebicep build / az bicep build

Cheat sheet

  • Bicep and ARM JSON are functionally equivalent. Bicep transpiles to ARM JSON
  • Both languages declare desired state, not a sequence of steps
  • Only $schema, contentVersion, and resources are required in an ARM template
  • Parameters are deploy-time inputs; variables are computed inside the template
  • Outputs return values from a finished deployment
  • Bicep resolves dependencies implicitly through symbolic names
  • Use dependsOn only when no implicit reference expresses the order
  • Incremental mode is the default and leaves untouched resources alone
  • Complete mode deletes resources in the group that aren't in the template
  • Complete mode has hard limits: root-level RG templates only, never locked groups
  • A redeploy reapplies the resource's full state, not just the properties you changed
  • Deployment scope is set by the template and must match the CLI command
  • Bicep targetScope defaults to resourceGroup
  • bicep decompile converts ARM JSON to Bicep; bicep build goes the other way
  • Decompilation is best-effort, so expect to fix the generated Bicep
  • Export a resource group as an ARM template to capture existing resources
  • You deploy .bicep and .json the same way. The CLI compiles Bicep for you
  • Bicep deploys a resource or module conditionally with an if expression after the equals sign
  • Define a resource once in a Bicep module and reference it to avoid duplicating code
  • A module's scope property targets a different resource group or subscription
  • Read a module's output with moduleName.outputs.outputName
  • Linked/nested templates must sit at a URI that Azure Resource Manager can reach
  • Chain linked templates with reference('deploymentName').outputs.name.value
  • what-if previews the changes; validate only checks the template can deploy
  • allowedValues constrains a parameter; a parameter file supplies values without editing the template

Unlock with Premium — includes all practice exams and the complete study guide.

Also tested in

References

  1. Template structure and syntax (ARM templates)
  2. Bicep file structure and syntax
  3. What is Bicep?
  4. Define the order for deploying resources (dependsOn)
  5. Deploy resources to resource groups
  6. Azure Resource Manager deployment modes
  7. Deployment stacks
  8. ARM template deployment what-if operation
  9. Export an ARM template from the Azure portal
  10. Decompile a JSON ARM template to Bicep