0Pricing
Azure Fundamentals · Lesson

Terraform on Azure

Configure the AzureRM Terraform provider, write a basic infrastructure plan, and understand when to prefer Terraform over native ARM/Bicep tooling.

What Is Terraform and Why Azure?

Terraform is an open-source Infrastructure as Code tool developed by HashiCorp. Unlike Bicep, Terraform is cloud-agnostic — a single Terraform codebase can manage resources across Azure, AWS, GCP, and many other providers simultaneously. On Azure, Terraform uses the AzureRM provider to interact with the ARM API, making it a popular choice for multi-cloud organisations.

The AzureRM Terraform Provider

The AzureRM provider is a plugin that Terraform downloads and uses to translate Terraform configuration into ARM API calls. It is maintained by HashiCorp and Microsoft and is the official way to manage Azure resources with Terraform. Configure the provider with your subscription ID and authentication method, then run terraform init to download it.

# main.tf — configure the AzureRM provider
terraform {
  required_providers {
    azurerm = {
      source  = 'hashicorp/azurerm'
      version = '~> 3.0'
    }
  }
}

provider 'azurerm' {
  features {}
  subscription_id = var.subscription_id
}

All lessons in this course

  1. How Azure Resource Manager Works
  2. Writing ARM Templates
  3. Bicep: Modern Azure IaC
  4. Terraform on Azure
← Back to Azure Fundamentals