AZ-900 ยท Managing and deploying resources
Infrastructure as code (IaC)
Managing infrastructure through declarative code: repeatability, version control, consistent environments, and Bicep and ARM templates as Azure options.
Key points
- Infrastructure as code: networks, VMs and other infrastructure defined in versioned files, not by hand.
- Same file, same environment every time (idempotence): no environment drift or snowflake setups.
- Changes: edit and review the code, then redeploy.
- Declarative: describe the end state, not the steps.
- Azure: ARM templates (JSON) and Bicep (converted to an ARM template at deployment); third-party tools such as Terraform also work.
Source: https://learn.microsoft.com/en-us/devops/deliver/what-is-infrastructure-as-code
Practice questions
What does infrastructure as code mean?
- Recording every portal click in a wiki so others can repeat it
- Defining and deploying infrastructure from versioned definition files
- Writing application code that runs on serverless infrastructure
- Paying for infrastructure only for the code that is running
Show answer
Answer: B. Defining and deploying infrastructure from versioned definition files
IaC means describing infrastructure in definition files that are versioned and deployed like application code. Documenting clicks, writing application code or using a cheaper pricing model are not IaC.
Which benefits does infrastructure as code bring?
- Identical environments can be deployed again and again
- Infrastructure changes are tracked and reviewed in version control
- Configuration drift between environments is reduced
- Deployments no longer need any kind of testing
- Each environment must first be configured by hand
Show answer
Answer: A. Identical environments can be deployed again and again, B. Infrastructure changes are tracked and reviewed in version control, C. Configuration drift between environments is reduced
IaC makes deployments repeatable, keeps infrastructure changes in version control where they can be reviewed, and reduces configuration drift between environments. It does not remove the need for testing (the code itself should be validated), and it replaces hand configuration rather than requiring it.
To use infrastructure as code on Azure you need a third-party tool, because Azure has no native IaC option.
Show answer
Answer: False
False. Azure supports IaC natively through Azure Resource Manager, with ARM templates in JSON and Bicep files. Third-party tools such as Terraform are an extra option, not a requirement.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
