Terraform is the dominant infrastructure-as-code tool for many teams. If you're on Azure and want to use Terraform—or you're aiming for HashiCorp's Terraform Associate cert—this post outlines a learning path that works: basics first, then Azure-specific, then certification prep.
Why Terraform and Azure Together
Azure has its own IaC options (Bicep, ARM). Terraform is provider-based and works across clouds. If you're in a multi-cloud or Terraform-first shop, or you want a single language for infra, Terraform + Azure provider is the combination. It also reinforces what you learn for AZ-104 and AZ-305: you're defining the same resources (VMs, storage, networking) in code, which deepens your understanding of how they fit together.
Phase 1: Terraform Basics
- Concepts: Declarative config, resources, providers, state. Why state exists and why you don't edit it by hand.
- Commands:
terraform init,plan,apply,destroy. What each does and when to use it. - Configuration: HCL syntax, resource blocks, variables (input and output), simple expressions. One resource group, one storage account.
- State: Local state first. Then remote state (e.g. Azure Storage backend) so you're not storing state on your laptop.
Hands-on: Install Terraform, add the Azure provider, create a resource group and a storage account. Run plan/apply. Tear it down with destroy. Move state to an Azure Storage backend.
Phase 2: Terraform and Azure in Practice
- Core resources: VNet, subnet, NSG, VM (or scale set), storage, App Service. Map AZ-104 concepts to Terraform resources. Use the Azure provider docs.
- Variables and structure: Organize with variables (tfvars, env vars). Use a simple module (e.g. "network" or "storage") so you see how modules work.
- State and collaboration: Remote state, state locking (Azure Storage with a container and lock). Why you need it when more than one person runs Terraform.
- CI/CD: Run Terraform from Azure DevOps or GitHub Actions: init, plan, apply (or plan in PR and apply on merge). Service principal or OIDC for auth.
Hands-on: Define a small Azure environment (resource group, VNet, subnet, NSG, one VM or one App Service). Parameterize with variables. Put state in Azure. Run apply from a pipeline.
Phase 3: Certification (HashiCorp Certified: Terraform Associate)
The cert tests:
- Terraform core (workflow, state, config language).
- Provider and module use.
- Provisioning and lifecycle.
- Terraform Cloud/Enterprise basics (if applicable).
Prep: Use HashiCorp's exam objectives as a checklist. Do the Terraform tutorials on the HashiCorp site (Azure track). Practice exams to get used to question style. Know the difference between plan and apply, when to use taint, how modules are called and how outputs flow. Know how to fix common state issues (e.g. drift, moving resources).
How This Fits With Azure Certs
- AZ-104: Terraform reinforces admin concepts. You're creating the same resources you'd create in the portal; you're just defining them in code. Doing both deepens understanding.
- AZ-305: Design decisions (what to deploy) stay the same; Terraform is one way to implement them. Knowing Terraform doesn't replace design knowledge, but it gives you a concrete way to express and version designs.
Resources
- HashiCorp Learn: Official tutorials, including "Terraform with Azure." Free.
- Azure provider docs: Registry.terraform.io/providers/hashicorp/azurerm. Use them when you're writing config.
- Practice: Build a small environment (e.g. hub-spoke, or a simple app stack). Refactor it into modules. Add a pipeline. That sequence covers most of what you need for real work and for the cert.
Terraform with Azure is a strong combination for anyone doing cloud infra. Learn the basics, apply them to Azure, then tighten with the certification objectives and practice. Good luck.
Related: Ace the AZ-104, AZ-305 key topics.