Best infrastructure as code tools for Microsoft Azure

OpenTofu is the open-source option that documents an Azure Blob Storage state backend with locking. Terraform documents the same backend under a Business Source License, and HCP Terraform is a HashiCorp-hosted service that the supplied documentation does not show running inside your Azure subscription.

On this page

Which infrastructure as code tools for Microsoft Azure can run under your Azure constraint

If your state, runs and credentials must stay in your Azure estate, OpenTofu (MPL-2.0) and Terraform (licensed under the Business Source License 1.1, which is not an OSI-approved license) both document an azurerm backend that keeps state as a blob in Azure Blob Storage with locking, so the state location alone does not separate them. HCP Terraform fails this constraint as documented. It is a HashiCorp-hosted service, and HashiCorp's docs did not show an Azure Marketplace listing for it, so it stays off the shortlist until you confirm in writing where its control plane runs and where your state and run data are stored. If your policy requires an OSI-approved license, Terraform is excluded before hosting is even considered. Start with OpenTofu's azurerm backend documentation and treat HCP Terraform as an open question for HashiCorp until the answer is in writing.

Terraform Enterprise is the HashiCorp option that could keep the control plane inside your Azure estate, because it is self-managed. Its pricing is custom and not published, so the quote is where the scope gets fixed. Before you shortlist it, confirm four things in writing: which Azure services and regions the installation supports, whether your team or HashiCorp installs and upgrades it, how its state backend is configured, and whether any HashiCorp service still receives state or run metadata. Ask legal to read the license as well. The Business Source License allows production use and treats internal use within an organization as non-competitive, but offering Terraform to third parties on a paid or hosted basis that overlaps with IBM's paid versions is restricted. An MSP or SaaS team that runs Terraform for customers needs that reading before it signs anything.

For OpenTofu, the checks are on the Azure side. Confirm the storage account, container and access model for the backend, confirm that the identity running tofu plan and tofu apply holds only the permissions it needs, and test that locking and consistency checking behave as documented in your own subscription before you migrate production state. OpenTofu sits under the Linux Foundation and was accepted to the CNCF at the Sandbox maturity level on April 23, 2025. That helps if your procurement wants a foundation-governed project, but it does not replace a support contract, so ask who supports your deployment and at what level. If you still want managed remote runs, review what HashiCorp documents for self-hosted agents and confirm with HashiCorp which parts of the run stay in your estate. Treat the runner as a separate decision from the state backend.

Where infrastructure as code tools for Microsoft Azure keep state, locks and runs

The table compares where OpenTofu, Terraform and HCP Terraform keep state, take locks and execute runs when the backend is Azure Blob Storage. Read each row for what the documented azurerm backend covers and what still needs your own storage account, network path or vendor service. Both CLI options document the same Azure Blob backend, while HCP Terraform's hosted runs and network path need confirmation with the vendor.

RequirementOpenTofuTerraformHCP Terraform
State stored as a blobThe azurerm backend stores state as a blob in Azure Blob Storage.The azurerm backend stores state as a blob in Azure Blob Storage.Remote state storage is included in all tiers. Confirm whether state lands in your own storage account.
LockingNative locking and consistency checking in the azurerm backend.State locking in the azurerm backend.Confirm with HashiCorp how locking behaves for hosted workspaces.
Storage account and access rightsYour team owns the account and its role assignments; confirm required roles in the backend guide.Your team owns the account and its role assignments; confirm required roles in the backend guide.Confirm whether HCP Terraform can use your storage account or only its own remote state.
Runs and runner network pathRuns happen where your CLI or CI runner executes; confirm the endpoints it needs to reach Azure.Runs happen where your CLI or CI runner executes; confirm the endpoints it needs to reach Azure.HashiCorp's guide lists Azure Container Instances and ARO for agents; confirm the network path to Azure and HCP Terraform.
Hosted control planeNo vendor control plane is needed for the CLI and backend; you run them yourself.No vendor control plane is needed for the CLI and backend; you run them yourself.The hosted service provides remote runs and VCS connections; confirm where runs execute.
Azure Marketplace listingConfirm with the OpenTofu project whether an Azure Marketplace listing exists.Confirm with HashiCorp whether an Azure Marketplace listing exists for Terraform.HashiCorp's docs do not list an Azure Marketplace listing; confirm with HashiCorp.
License and vendor dependencyMPL 2.0, Linux Foundation stewardship and CNCF Sandbox since April 23, 2025.Business Source License 1.1 from version 1.6.0; internal use is allowed, but competing hosted offerings are restricted.Per the HashiCorp pricing page: Essentials $0.10, Standard $0.47 and Premium $0.99 per resource per month.
Cost drivers to confirmCosts are your Azure storage, runner compute and operator time; confirm any vendor support fees.Same runner and storage costs; confirm with IBM or HashiCorp any paid support arrangement.Per-resource subscription plus agent hosting in your Azure; confirm resource counting and Azure egress.

What an Azure constraint demands of an infrastructure as code tool

Any Azure-bound team needs remote state in a storage account before anything else, and the standard place for it is a blob container in an Azure storage account. OpenTofu's azurerm backend stores state as a blob in Azure Blob Storage with native locking and consistency checking, so two pipeline runs cannot apply against the same state at once. Terraform documents the same storage pattern with state locking. Before the first init, confirm that the storage account and container exist, that blob versioning or soft delete is enabled so a bad apply can be recovered, and that the storage account's network rules admit only the subnets your runners use. Give the identity that touches state data-plane permissions on that one container, and check whether the backend block can use Entra ID authentication through a setting such as use_azuread_auth, so storage account keys stay out of your pipelines.

The runner decides whether your pipelines can reach Azure at all. A runner must reach Azure APIs and the state storage endpoints. A runner inside your network needs outbound paths to Azure Resource Manager and to the storage account endpoints, and a hosted control plane needs its own route to those endpoints, which you must confirm with the vendor before you disable public network access on the storage account. For self-run agents, the Azure hosts named for this purpose are Azure Container Instances and Azure Red Hat OpenShift (ARO). HashiCorp's self-hosted agents guide is the starting point, but confirm in that guide that these two hosts are listed before you cite it in a design or security review. Choose the host by what you already operate: a team with no cluster may find a container group simpler to start, while a team already running OpenShift will likely want runners beside its other workloads. Test either choice against the storage endpoint rules above.

Credentials and the control plane shape your audit trail more than any other choice. Keep secrets out of code by giving the runner an Azure identity, such as a managed identity or a workload identity federated to your pipeline, and set provider values such as ARM_TENANT_ID, ARM_SUBSCRIPTION_ID and ARM_USE_OIDC in the runner's environment, outside the repository. Confirm that the tool you choose supports the identity method you plan to use. Then answer where the control plane runs. With a self-run OpenTofu or Terraform binary, plan, apply and state handling stay inside your subscription, and the logs remain yours to keep. HCP Terraform keeps remote state, secure variables and remote runs in HashiCorp's service, so review the HCP data location overview and the Europe option before approval, and ask the vendor in writing where state is stored and who can read it.

Four options for infrastructure as code tools for Microsoft Azure, with license and Azure fit

These four options split along two lines: who owns the license and who runs the control plane. OpenTofu and Terraform are the tools themselves, while HCP Terraform and Terraform Enterprise are HashiCorp's hosted and self-managed products. Each card gives the Azure fit as documented and the one condition under which that option is the right choice.

OpenTofu under MPL-2.0

OpenTofu is a Terraform fork licensed under the Mozilla Public License 2.0, stewarded by the Linux Foundation and accepted to the CNCF Sandbox on April 23, 2025. The project describes it as a drop-in replacement, so existing configurations should carry over, but test your providers and modules before you migrate. On Azure, the azurerm backend stores state as a blob in Azure Blob Storage with native locking and consistency checking. Choose OpenTofu when an MPL-2.0 license and state kept in your own storage account are the priority and you plan to source support separately.

azurerm backend docs

Terraform under BSL 1.1

Terraform 1.6.0 and later are licensed under the Business Source License 1.1, with International Business Machines Corporation (IBM) as licensor, so this is not OSI open source. Production use is allowed, and using Terraform internally within an organization is not treated as a competitive offering. On Azure, HashiCorp documents an azurerm backend that stores state in Azure Blob Storage with state locking. Choose Terraform when you want HashiCorp's product directly and your use stays internal. Have counsel confirm that you are not offering Terraform to third parties on a paid or hosted basis that overlaps IBM's paid versions.

Terraform azurerm docs

HCP Terraform hosted tiers

HCP Terraform is HashiCorp's hosted service, sold in Essentials, Standard and Premium tiers. The HashiCorp pricing page lists Essentials at $0.10 per resource per month, Standard at $0.47 and Premium at $0.99, and every tier includes remote state storage, VCS connections and remote runs. Standard and Premium add unlimited module publishing and no-code provisioning. On Azure, the azurerm backend is documented, but HashiCorp's docs list no Azure Marketplace listing for HCP Terraform, so ask how you would buy it through Azure. Choose it when a hosted control plane is acceptable for the data your runs touch.

HCP Terraform overview

Terraform Enterprise self-managed

Terraform Enterprise is the self-managed edition, and the HashiCorp pricing page lists custom pricing for it, so the cost comes from a written quote. Confirm the Azure deployment model with HashiCorp before you design the network, identity and storage layout, since supported hosting options determine those choices. Ask who handles upgrades and backups of the platform, because that work falls to your team in a self-run model. Choose it when the control plane must run inside your own Azure subscription and you accept a negotiated price and self-run operations.

Running infrastructure as code tools for Microsoft Azure day to day

With OpenTofu, your team owns the state path end to end. The azurerm backend stores state as a blob in Azure Blob Storage and provides native locking and consistency checking, so the storage account and container sit in your own Azure subscription. OpenTofu is licensed under the Mozilla Public License 2.0 and is under Linux Foundation stewardship, so the software itself carries no license fee. Your costs are Azure resources, the runners that execute plans, and the staff who operate them.

  • Backend setup: Add a backend block for azurerm with the storage account, container and state key, then run tofu init to migrate state. Confirm the exact arguments and authentication options in the backend documentation before you write the block.
  • Locking and consistency: Locking and consistency checks are native to the backend. Confirm how a stuck lock is cleared, who may break it, and how an interrupted apply is recovered in a test environment.
  • Upgrades: New OpenTofu releases are published on the GitHub releases page. Read the release notes before you move a shared state file to a newer version, and confirm the supported upgrade path between minor versions.
  • What your team monitors: Watch storage account access logs, who holds write permission on the state container, blob versioning or backup settings for state, and the OpenTofu version each pipeline uses.
  • Who pays: Your team pays Azure for Blob Storage and compute, and pays its own staff for upgrades and incident response. Ask Azure for current storage pricing rather than relying on estimates.

Before go-live, test lock recovery and state restore in a non-production subscription, because the supported material does not describe these steps in detail.

Why the Terraform license matters for an Azure estate

For an Azure estate run by one organization, the internal use question is usually settled in Terraform's favor. The Terraform LICENSE file names International Business Machines Corporation (IBM) as licensor and applies the Business Source License 1.1 to Terraform version 1.6.0 or later. The grant allows production use, and the license states that hosting or using Terraform for internal purposes within an organization is not a competitive offering. The restriction targets something narrower: offering Terraform to third parties on a hosted or embedded basis to compete with IBM's paid versions. A platform team that deploys into its own Azure subscriptions, keeps state in its own storage account and runs pipelines in its own tenant reads as outside that restriction, but counsel should confirm the reading against the license text and the organization's own structure.

The clause to check is the definition of a competitive offering. The license defines it as a product offered to third parties on a paid basis, including through paid support arrangements, that significantly overlaps with the capabilities of IBM's paid versions. A paid support contract can therefore bring a service inside the definition, even when the underlying software is free to download. Teams that bundle Terraform into a managed service with a support fee should compare what customers receive against the capabilities of IBM's paid versions. Illustrative example: a provider that runs Terraform for customers in their own Azure tenants and charges a monthly support fee would need that overlap analysis before signing. The word significantly calls for a legal reading, so the answer depends on facts a lawyer should review.

The second point is time. Each version of Terraform converts to MPL 2.0 four years after it is published, so the terms that apply depend on the versions you pin in your modules and pipelines. OpenTofu is licensed under the Mozilla Public License 2.0 and operates under Linux Foundation stewardship, which avoids the change-date question for teams that want a permissive license from the start. If you build managed services on Azure for customers, get a legal review before choosing. Ask the reviewer to cover the license, your customer contracts and the support terms you plan to sell, and to confirm how the change date applies to each Terraform version you intend to use. Check versions before 1.6.0 separately, because the terms cited here cover 1.6.0 or later.

How state, locks and runs move between the CLI, Azure Blob Storage and the hosted service

The left path starts with a CLI run that uses the azurerm backend. It reads and writes the state blob and takes the state lock in Azure Blob Storage, then applies changes to Azure resources. The right path is an HCP Terraform run that executes in HashiCorp's hosted service and reaches Azure with credentials you provide. HCP state is held in the hosted service's remote state storage, so it does not sit in your blob container. Before you rely on this design, confirm the HCP data location and where runners are placed, because both are open items here. Also check how the credentials are issued and scoped.

State and locks sit in Azure Blob Storage; HCP runs execute in HashiCorp's service.

What switching between OpenTofu and Terraform costs later

Changing the engine from Terraform to OpenTofu is the smallest part of this decision, but it still needs proof in your own Azure subscription. The OpenTofu website describes the project as a drop-in replacement that preserves existing workflows and configurations, and the OpenTofu azurerm backend documentation describes state stored as a blob in Azure Blob Storage with native locking and consistency checking. That tells you what to expect, not how your estate behaves. Before cutover, run a plan against a copy of production state and confirm it shows no unexpected changes. Check the backend block (storage account, container, state key and the authentication method your pipeline uses), confirm that a lock is taken during a concurrent run, and pin provider versions in .terraform.lock.hcl so both binaries resolve the same providers. Keep the test results so the change can be reviewed later.

Leaving HCP Terraform carries a different cost. State, variables and run history sit in the HashiCorp service, and how each one can be exported is something you must confirm with HashiCorp before you set a migration date. Ask in writing how current and historical state versions can be downloaded, whether variable values can be read back out (and whether sensitive values are included at all), and what happens to run history, workspace settings and VCS connections. Each answer sets the size of the migration. If state can only be retrieved one version at a time, plan a longer freeze window. Write the answers into the statement of work so they are agreed deliverables. Your team should then rebuild variables, access and policy settings in the new backend before the old workspaces are retired.

The longer-term cost depends on which engine you keep. OpenTofu is licensed under the Mozilla Public License 2.0 and was accepted to the CNCF at the Sandbox maturity level. Terraform 1.6.0 and later is under the Business Source License 1.1 from IBM, which allows production use for internal purposes but restricts offering Terraform to third parties in a way that competes with IBM's paid versions. A service that embeds Terraform for paying customers is the case to put in front of counsel. Whichever path you take, the recurring work is pipeline upkeep, provider upgrades and a retest after each version change. Ask any implementation partner for a quote that itemizes the backend test, the state validation, the cutover window, the retirement of HCP Terraform workspaces and the first upgrade cycle, so you can see which items are one-time and recurring costs.

What buyers ask before hiring help with infrastructure as code tools for Microsoft Azure

How much effort does an Azure infrastructure as code rollout need?

Effort follows the size and layout of the estate, and four counts drive most of it: the Azure subscriptions in scope, the number of modules and how they depend on each other, the state layout (for example, one state file per environment, per subscription or per workload), and the number of runners that execute plans and applies. A single subscription with a few modules and one state file is a bounded job. Several subscriptions with separate landing zones, shared networking modules and per-team state usually add design work, pipeline setup and access testing for each layer. Ask the provider to confirm each of these four counts in writing before any timeline is discussed, since each one changes the scope of the agreed work.

What must our team provide before infrastructure as code work starts on Azure?

The team needs to provide working Azure access, decisions on where state lives, and a defined change approval path. Access means identities with the rights to create, read and modify resources in each subscription in scope, plus a service principal or managed identity for the pipeline, ideally limited per environment. State storage decisions cover the storage account that holds the state blobs, its resource group, network access rules, encryption and who may read the state, because state files can contain sensitive values. The azurerm backend in OpenTofu's documentation is one reference point for these settings. Change approvals cover who reviews plans, who can approve production applies and whether pull requests or tickets must record each approval.

Can an experienced team set up Azure infrastructure as code alone?

An experienced team with Azure, Terraform or OpenTofu and pipeline skills can often do the work alone, and the deciding factors are usually capacity and review independence rather than tooling. The first build involves the same core tasks for any team: module structure, the remote state backend, locking, pipeline permissions and a plan review process. Teams that have already run a remote backend and a reviewed plan pipeline face fewer unknowns. Outside help tends to make sense when the team lacks Azure identity or networking experience, has no one independent to review the design, or must document controls for an upcoming compliance assessment. Ask for the written scope to list deliverables such as the module layout, a runbook and a handover session, so the team can judge the gap honestly.

What drives HCP Terraform cost for an Azure estate?

HCP Terraform cost is driven mainly by the number of resources under management and the tier you choose. The HashiCorp pricing page lists Essentials at $0.10 per resource per month ($0.00013 per hour), Standard at $0.47 per resource per month and Premium at $0.99 per resource per month, with Terraform Enterprise (self-managed) and HCP Terraform Europe at custom pricing. Count the Azure resources in each workspace, including those created through modules, and multiply by the tier rate to check a rough estimate. Essentials limits test-integrated module publishing to 10 modules, while Standard and Premium add unlimited module publishing and change requests. Remote state, VCS connections, the private registry and remote runs are included in every tier. Confirm current rates and resource counting rules with HashiCorp before you commit, since the pricing page can change.

What should a quote for Azure infrastructure as code include?

A quote should follow from a written scope that names the subscriptions, modules, state layouts, runners, pipelines and deliverables. DeployOpen does not publish a price list, and most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. Ask the provider to state which subscriptions and environments are covered, which modules are built or reviewed, how state storage and locking are set up, where runners execute, and which approvals and access reviews are included. Ask for the acceptance criteria, the handover method and what happens if Azure access is delayed. Separate one-time build work from recurring costs such as tool subscriptions, runner hosting, storage and any retainer for upgrades or continuous testing, and ask for each recurring item on its own line.

Who owns the code and state after an Azure IaC engagement ends?

The client should own the code, modules, pipeline definitions and state storage, and the written scope should say so. Ask for the repositories, module sources and backend configuration to be transferred into the client's own Git and Azure tenants, with access documented. Confirm who holds the identities the pipeline uses and whether any service principal created during the work is removed or handed over. Ask for a handover session and a runbook covering how to add a subscription, rotate credentials, recover from a stuck state lock and upgrade the tool version. Continuing support, upgrades and continuous testing are available as retainers, so decide before work starts whether the team will need them after handover.

How hard is it to switch between OpenTofu and HCP Terraform later?

Switching is easier when configuration and state stay in standard formats. OpenTofu's website describes it as a drop-in replacement that preserves existing workflows and configurations, and both tools document an azurerm backend that stores state as a blob in Azure Blob Storage with locking. You should still confirm the backend block and locking behavior in each tool's documentation before moving state. The larger switching cost is the HCP Terraform platform layer: workspaces, variables, VCS connections, the private registry and run history must be exported or rebuilt on the other side. Terraform 1.6.0 and later are licensed under the Business Source License 1.1, while OpenTofu is under the Mozilla Public License 2.0, so have counsel confirm the license terms that apply to your use.

How DeployOpen helps teams run infrastructure as code on Microsoft Azure without favoring a tool

DeployOpen plans, implements, integrates, documents and supports self-hosted open-source platforms inside your own cloud accounts. For Azure, that means scoping the infrastructure as code work around the tool you choose, whether OpenTofu under the MPL 2.0 or HCP Terraform and Terraform under their own terms, and building it in your subscriptions. The result is documented work your team can run, checked against your licensing position and skills.

How we scope

  • Written scope names which Azure subscriptions, resource groups and state backends the IaC work covers.
  • We confirm the tool choice, OpenTofu or HCP Terraform, against your licensing position and team skills before build starts.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts; ongoing support is available as a retainer.

How we build

  • We write Terraform or OpenTofu modules for the Azure resources in scope, with state held in an azurerm backend.
  • For OpenTofu, state sits in an Azure Blob Storage container with native locking and consistency checking.
  • Terraform's documented azurerm backend also stores state as a blob with state locking.

How we hand over

  • Handover covers module code, backend configuration, runbooks and state recovery steps agreed in the written scope.
  • Your team receives documentation for running plans, applying changes and managing the OpenTofu or Terraform version in use.
  • Confirm in writing who holds Azure credentials and state access at handover.

How we support

  • Retainers can cover upgrades, ongoing support and continuous testing of the Azure setup.
  • Support can revisit the tool choice if licensing changes, since Terraform 1.6.0 and later use Business Source License 1.1.
  • Ask for the support scope, response arrangements and upgrade responsibilities in the written quote before you commit.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.