Bird
Raised Fist0
Azurecloud~10 mins

ARM vs Bicep vs Terraform decision in Azure - Visual Side-by-Side Comparison

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Process Flow - ARM vs Bicep vs Terraform decision
Start: Need to deploy Azure infrastructure
Choose tool: ARM, Bicep, or Terraform?
ARM Template
Write JSON
Deploy via Azure
Infrastructure created in Azure
End
This flow shows the decision process for choosing ARM, Bicep, or Terraform to deploy Azure infrastructure, and how each tool works to create resources.
Execution Sample
Azure
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' = {
  name: 'mystorage'
  location: 'eastus'
  kind: 'StorageV2'
  sku: {
    name: 'Standard_LRS'
  }
}
This Bicep code defines a storage account resource in Azure with basic properties.
Process Table
StepToolActionInputOutputNotes
1DecisionChoose deployment toolNeed Azure infraSelect ARM, Bicep, or TerraformStart of process
2ARMWrite JSON templateJSON syntaxARM template fileManual JSON, verbose
3BicepWrite Bicep codeSimpler syntaxBicep fileEasier than ARM JSON
4BicepCompile BicepBicep fileARM JSON templateBicep compiles to ARM
5TerraformWrite HCL codeTerraform syntaxTerraform config filesMulti-cloud support
6ARM/BicepDeploy templateARM JSON templateAzure resources createdUses Azure native deployment
7TerraformRun terraform applyTerraform configAzure resources createdTerraform manages state
8EndInfrastructure readyDeployed resourcesResources available in AzureDeployment complete
💡 Infrastructure deployed successfully using chosen tool
Status Tracker
VariableStartAfter Step 2After Step 4After Step 6Final
Template CodeNoneARM JSON template createdARM JSON template from BicepARM JSON deployedResources deployed
Bicep CodeNoneNoneBicep code writtenCompiled to ARM JSONARM JSON deployed
Terraform ConfigNoneNoneNoneTerraform config writtenResources deployed
Key Moments - 3 Insights
Why do we need to compile Bicep code before deployment?
Because Azure only understands ARM JSON templates, Bicep code must be converted to ARM JSON before deployment, as shown in execution_table step 4.
Can Terraform deploy resources outside Azure?
Yes, Terraform supports multiple clouds, unlike ARM and Bicep which are Azure-specific, as noted in execution_table step 5.
Why is ARM template considered verbose compared to Bicep?
ARM templates use JSON which is more detailed and harder to write, while Bicep uses simpler syntax that compiles to ARM JSON, shown in steps 2 and 3.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step does Bicep code get converted to ARM JSON?
AStep 3
BStep 4
CStep 5
DStep 6
💡 Hint
Check the 'Action' column for 'Compile Bicep' in execution_table row 4
According to variable_tracker, which variable changes after Step 4?
ATemplate Code
BTerraform Config
CBicep Code
DNone
💡 Hint
Look at 'Template Code' row and its value after Step 4 in variable_tracker
If you want to manage infrastructure across multiple clouds, which tool is best based on execution_table?
AARM
BBicep
CTerraform
DNone
💡 Hint
See notes in execution_table step 5 about multi-cloud support
Concept Snapshot
ARM, Bicep, and Terraform are tools to deploy Azure infrastructure.
ARM uses JSON templates, which are verbose.
Bicep is simpler syntax that compiles to ARM JSON.
Terraform uses HCL and supports multiple clouds.
Choose based on complexity, multi-cloud needs, and ease of use.
Full Transcript
This visual execution shows how to decide between ARM, Bicep, and Terraform for deploying Azure infrastructure. First, you pick a tool. ARM requires writing JSON templates directly. Bicep lets you write simpler code that compiles into ARM JSON. Terraform uses its own language and can manage resources across clouds. The execution table traces each step from writing code to deploying resources. Variable tracking shows how code changes form and get deployed. Key moments clarify why Bicep compiles to ARM and Terraform's multi-cloud ability. The quiz tests understanding of these steps and tool differences.

Practice

(1/5)
1. Which tool is native to Azure and uses JSON for defining infrastructure?
easy
A. Terraform
B. Bicep
C. ARM templates
D. Ansible

Solution

  1. Step 1: Understand native Azure tools

    ARM templates are the original native infrastructure-as-code tool for Azure using JSON format.
  2. Step 2: Compare with other tools

    Bicep simplifies ARM but is not JSON; Terraform is multi-cloud and not native Azure.
  3. Final Answer:

    ARM templates -> Option C
  4. Quick Check:

    Native Azure tool with JSON = ARM templates [OK]
Hint: Native Azure + JSON = ARM templates [OK]
Common Mistakes:
  • Confusing Bicep as native JSON tool
  • Thinking Terraform is Azure native
  • Selecting Ansible which is not Azure native
2. Which syntax correctly declares a resource in Bicep?
easy
A. resource vm 'Microsoft.Compute/virtualMachines@2021-07-01' = { name: 'myVM' }
B.
C. resource "vm" { type = "Microsoft.Compute/virtualMachines" name = "myVM" }
D. vm_resource = { type: 'Microsoft.Compute/virtualMachines', name: 'myVM' }

Solution

  1. Step 1: Identify Bicep syntax

    Bicep uses the keyword 'resource' followed by a symbolic name, type with API version, and properties in braces.
  2. Step 2: Compare options

    resource vm 'Microsoft.Compute/virtualMachines@2021-07-01' = { name: 'myVM' } matches Bicep syntax; the XML-like syntax is invalid, the HCL-style block is Terraform syntax, and the plain object is invalid.
  3. Final Answer:

    resource vm 'Microsoft.Compute/virtualMachines@2021-07-01' = { name: 'myVM' } -> Option A
  4. Quick Check:

    Bicep resource syntax = resource vm 'Microsoft.Compute/virtualMachines@2021-07-01' = { name: 'myVM' } [OK]
Hint: Bicep uses 'resource name type@version = { }' syntax [OK]
Common Mistakes:
  • Choosing Terraform syntax for Bicep
  • Confusing ARM JSON/XML with Bicep
  • Using invalid assignment formats
3. Given this Terraform snippet:
resource "azurerm_resource_group" "rg" {
  name     = "example-rg"
  location = "eastus"
}

What will happen when you run terraform apply?
medium
A. Deletes existing resource groups in East US
B. Fails because 'azurerm_resource_group' is invalid
C. Creates a virtual machine instead of a resource group
D. Creates a resource group named 'example-rg' in East US

Solution

  1. Step 1: Understand Terraform resource block

    The block defines an Azure resource group named 'example-rg' in 'eastus' location.
  2. Step 2: Predict Terraform apply behavior

    Terraform will create the resource group if it doesn't exist, no deletion or VM creation occurs.
  3. Final Answer:

    Creates a resource group named 'example-rg' in East US -> Option D
  4. Quick Check:

    Terraform resource block creates defined resource [OK]
Hint: Terraform resource block creates specified resource [OK]
Common Mistakes:
  • Thinking resource type is invalid
  • Confusing resource group with VM
  • Assuming deletion happens automatically
4. You try to deploy an ARM template but get a syntax error. Which is the most likely cause?
medium
A. Missing resource group in Terraform provider
B. Using Bicep syntax directly in ARM JSON template
C. Incorrect API version in Bicep resource declaration
D. Using Terraform commands on ARM template

Solution

  1. Step 1: Identify syntax error source

    ARM templates require JSON syntax; using Bicep syntax directly causes errors.
  2. Step 2: Eliminate other options

    Missing resource group affects Terraform, not ARM JSON; API version errors in Bicep cause deployment errors but not syntax errors; Terraform commands on ARM templates cause command errors, not syntax errors.
  3. Final Answer:

    Using Bicep syntax directly in ARM JSON template -> Option B
  4. Quick Check:

    ARM JSON syntax error = Bicep syntax used wrongly [OK]
Hint: ARM templates need JSON, not Bicep syntax [OK]
Common Mistakes:
  • Mixing Bicep syntax in ARM JSON
  • Confusing deployment errors with syntax errors
  • Assuming Terraform errors affect ARM templates
5. Your company uses Azure and AWS. You want a single tool to manage infrastructure on both clouds with reusable code. Which tool should you choose?
hard
A. Terraform
B. Bicep
C. Azure CLI scripts
D. ARM templates

Solution

  1. Step 1: Identify multi-cloud support

    Terraform supports multiple cloud providers including Azure and AWS with reusable code modules.
  2. Step 2: Compare other tools

    ARM and Bicep are Azure-only; Azure CLI scripts are Azure-specific and not declarative infrastructure code.
  3. Final Answer:

    Terraform -> Option A
  4. Quick Check:

    Multi-cloud infrastructure tool = Terraform [OK]
Hint: Terraform works across clouds, ARM/Bicep only Azure [OK]
Common Mistakes:
  • Choosing ARM or Bicep for multi-cloud
  • Thinking Azure CLI manages AWS
  • Ignoring Terraform's multi-cloud strength