Introduction to Infrastructure as Code

MS Learn module: Explore infrastructure as code · Learning objectives: explain what infrastructure as code (IaC) is, why it’s a core DevOps practice, and contrast declarative vs imperative / inferential provisioning.

Overview

The entry point to the “Manage infrastructure as code using Azure” path. It frames infrastructure-as-code as the umbrella practice: defining Azure resources as versioned, reviewable code instead of Portal clicks, and explains the two families of tooling (declarative templates vs configuration management) and why idempotent, desired-state is the goal.

Units / lessons covered

  • What is infrastructure as code and why it matters to DevOps
  • Declarative (bicep / arm-template / terraform) vs imperative (CLI runbooks)
  • Desired state and idempotency; drift as the failure mode
  • az deployment what-if / terraform plan as the “preview” step

Key terms / commands

  • Declarative vs imperative · idempotent · desired state · az deployment group what-if · terraform plan · az deployment validate

Hands-on / what to try

Compare a one-off az vm create (imperative) against the same resource declared in a .bicep file; run terraform plan on a returned template to see the diff-before-apply model.

Exam focus

  • Know IaC = declarative + idempotent + versioned; the exam opens every IaC question with these properties.
  • Contrast the template layer (bicep/arm-template) with config-management (inside-VM) state.

Path MOC · use-bicep-arm · terraform-in-azure · configuration-and-drift