What does 'infrastructure as code' (IaC) mean in the context of Azure?
Defining Azure resources in configuration files is the essence of Infrastructure as Code: resource definitions are written in declarative languages like Bicep, ARM templates (JSON), or Terraform, capturing the desired state of the environment. These files can be stored in version control (e.g., Git), enabling code review, audit trails, and rollbacks, and they can be reused across environments (dev, test, prod) to produce consistent, repeatable deployments. This approach shifts infrastructure management from imperative manual steps to a codified, reviewable artifact.
Why this answer
Infrastructure as Code (IaC) in Azure involves defining and managing Azure resources (e.g., virtual networks, VMs, storage accounts) using declarative configuration files such as ARM templates, Bicep, or Terraform. These files can be stored in version control (e.g., Git), enabling repeatable, consistent deployments and rollbacks through automation, rather than manual or imperative steps.
Exam trap
The trap here is that candidates confuse IaC with imperative scripting (Option C) or with running application code on Azure (Option A), but IaC specifically means defining infrastructure in version-controlled, declarative configuration files.
How to eliminate wrong answers
Option A is wrong because writing code that runs directly on Azure hardware describes custom runtime code or Azure Functions, not IaC; IaC focuses on resource provisioning, not application execution. Option C is wrong because using Azure CLI scripts to deploy one resource at a time imperatively is a manual, procedural approach, not IaC; IaC emphasizes declarative, idempotent configuration files that define the entire desired state. Option D is wrong because converting physical server hardware into virtual machines describes server virtualization or migration (e.g., Azure Migrate), not IaC; IaC is about codifying infrastructure definitions, not hardware abstraction.