Terraform: Declarative Infrastructure as Code with HCL
Terraform is an Infrastructure as Code (IaC) tool from HashiCorp. You describe the desired state of your infrastructure in HashiCorp Configuration Language (HCL), Terraform compares it with the recorded state and the real resources, and it shows a plan before changing anything. Providers translate HCL into API calls, so the same workflow covers Azure, other clouds, Azure DevOps, GitHub and many SaaS products.
For teams working with .NET and Azure, Terraform is often the choice when infrastructure spans more than one platform or when a team already has HCL modules in place. The plan step is the real value: it turns an infrastructure change into something a reviewer can read in a pull request, just like code.
Key Concepts
State: Terraform keeps a state file that maps your configuration to real resources. Store it in a remote backend (for example an Azure Storage account) with locking, and treat it as sensitive, because it can contain secrets in plain text.
Providers and versions: Resources come from providers such as hashicorp/azurerm or azure/azapi. Pin provider versions and read the changelog before upgrading, since new Azure features and breaking changes arrive through provider releases.
Modules: Modules package reusable building blocks. Small, well-typed modules with clear inputs and outputs are easier to review and test than one large root configuration.
License: Since version 1.6, Terraform is released under the Business Source License (BSL) instead of the Mozilla Public License (MPL) 2.0. For most internal use this changes nothing, but it is the reason the community fork OpenTofu exists.
Related Topics
Terraform belongs to the broader Infrastructure as Code practice and is the main alternative to Bicep for Azure deployments. It usually runs inside CI/CD pipelines in Azure DevOps or GitHub Actions. The official Terraform documentation and the AzureRM provider reference are the primary references.
