Covers Bicep, ARM JSON, Terraform, OpenTofu and Pulumi compared on state management, provider coverage, multi-cloud, language and team skills, licensing (Terraform BSL, IBM ownership, OpenTofu MPL), previews and the decision for an Azure-first team.
Bicep is Azure's own language: it compiles to ARM JSON, has no state file (ARM holds the live state), supports new Azure features on day one, and with deployment stacks can track and clean up what it owns. Terraform (and its open-source fork OpenTofu) uses HCL and a state file, and its strength is providers for almost everything: Azure, AWS, GitHub, Cloudflare, Entra ID. Pulumi gives you the same model in C# or TypeScript.
For an Azure-only team I default to Bicep; if we manage non-Azure resources or multiple clouds, Terraform or OpenTofu. The trade-off is simplicity versus reach.
"I frame it as three questions: what are we managing, who is writing it, and how much state do we want to look after. Bicep is a thin, type-safe language over ARM templates: you write Bicep, it compiles to ARM JSON, and Azure Resource Manager does the work. There is no state file; ARM is the state. New Azure resource types and API versions work immediately because Bicep just targets the ARM API, and since deployment stacks went GA you can also get 'delete what I removed from the template' behaviour and deny settings, with what-if previews for stacks too. Nobody should write raw ARM JSON for new work any more.
Terraform uses HCL and providers. The azurerm and azapi providers cover Azure, but the same tool also manages GitHub repositories, Cloudflare DNS, Entra app registrations, Datadog monitors or AWS. The cost is the state file: it lives in a remote backend, usually an Azure Storage container with blob-lease locking, it can contain secrets, and if it gets out of sync with reality you are doing
terraform importandstate mvsurgery. Licensing matters in procurement conversations: HashiCorp moved Terraform from MPL 2.0 to the Business Source Licence in August 2023, IBM completed its acquisition of HashiCorp in February 2025, and OpenTofu is the MPL-licensed fork under the Linux Foundation. For a normal company using Terraform internally the BSL is not a blocker, but some government and vendor teams prefer OpenTofu. Pulumi is the same desired-state model written in C#, which .NET teams like, with the risk that infrastructure becomes clever object-oriented code nobody can review.For an Azure-first Australian organisation I'd pick Bicep unless there is a clear reason not to, and Terraform or OpenTofu when the platform team manages several clouds or many non-Azure resources. The mistake I see is choosing the tool on popularity rather than on what you manage and who maintains it."
| Bicep | ARM JSON | Terraform | OpenTofu | Pulumi | |
|---|---|---|---|---|---|
| Language | Bicep DSL | JSON | HCL | HCL (compatible) | C#, TS, Python, Go, YAML |
| State | ARM (none to manage); stacks for ownership | ARM | State file, remote backend | State file, optional state encryption | Pulumi Cloud or self-managed backend |
| Preview | what-if (incl. stacks) |
what-if |
plan |
plan |
preview |
| Coverage | Azure (plus extensions such as Microsoft Graph) | Azure | Thousands of providers | Same providers via its registry | Many providers, native Azure |
| New Azure features | Day zero | Day zero | Provider release, or azapi day zero |
Same as Terraform | azure-native generated quickly |
| Licence | MIT | n/a | BSL 1.1 | MPL 2.0 | Apache 2.0 (engine) |
| Situation | Pick | Why |
|---|---|---|
| Azure only, app teams own infra | Bicep | Least moving parts, no state to protect |
| Platform team, Azure + GitHub + DNS + monitoring | Terraform or OpenTofu | One tool, one workflow for everything |
| Licence-sensitive vendor or public sector | OpenTofu (or Bicep) | Open-source licence, community governance |
| Strong C# team, complex generated infra | Pulumi | Real language, tests with xUnit |
| Legacy ARM JSON estate | Decompile to Bicep (az bicep decompile) |
Clean up gradually |
A common pattern: application teams own their resources in Bicep inside each service repo, while a small platform team uses Terraform for landing zones, GitHub organisation settings and DNS. Each team deploys in minutes, and the platform team's state lives in a locked, private storage account with versioning and soft delete, so a bad state write can be rolled back.
Checks whether the candidate can choose an IaC tool on engineering and organisational grounds, and understands state, coverage and licensing accurately.
Green flags
Red flags
Bicep / ARM Terraform / OpenTofu / Pulumi
----------- -----------------------------
template ──► ARM ──► live resources code ──► plan ──► provider ──► live resources
│ ▲
deployment history │
(stacks: managed list state file
of owned resources) (address ↔ resource id, attributes)
actionOnUnmanage decides whether removed ones are detached or deleted; denySettings can stop people editing or deleting them outside the stack.azurerm pointing at a dedicated storage account, use_azuread_auth = true so no account key is needed.For internal use the BSL rarely matters; it matters if you build a product or service that offers Terraform-like functionality, or if your organisation's open-source policy requires OSI licences.
azurerm provider wraps resources by hand, so new features can lag; the azapi provider calls ARM directly and closes the gap.Pulumi lets you write loops, functions and unit tests in C#. That helps generated or highly repetitive infrastructure, but reviewers must read general-purpose code to understand what will be deployed, so keep it boring: no deep inheritance, no hidden network calls.
terraform state list and terraform state show and read what is stored, including any sensitive attributes.terraform plan and az deployment group what-if and compare how each tool reports it.az bicep decompile on an old ARM JSON template and review the result.az stack group create --action-on-unmanage detachAll, remove a resource from the template, and redeploy.The same hardened storage account in three tools.
// Bicep: no backend, ARM is the state
param location string = resourceGroup().location
resource st 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: 'stordersprod${uniqueString(resourceGroup().id)}'
location: location
sku: { name: 'Standard_ZRS' }
kind: 'StorageV2'
properties: {
minimumTlsVersion: 'TLS1_2'
allowBlobPublicAccess: false
allowSharedKeyAccess: false
}
}
# Terraform / OpenTofu: the state backend is the first thing you design
terraform {
required_providers {
azurerm = { source = "hashicorp/azurerm", version = "~> 4.0" }
}
backend "azurerm" {
resource_group_name = "rg-tfstate-prod"
storage_account_name = "sttfstateprod"
container_name = "tfstate"
key = "orders/prod.tfstate" # one state per component and env
use_azuread_auth = true # Entra auth, no storage key
}
}
provider "azurerm" {
features {}
# azurerm v4 needs a subscription: set ARM_SUBSCRIPTION_ID in the pipeline
}
resource "azurerm_resource_group" "orders" {
name = "rg-orders-prod"
location = "australiaeast"
}
resource "azurerm_storage_account" "orders" {
name = "stordersprod01"
resource_group_name = azurerm_resource_group.orders.name
location = azurerm_resource_group.orders.location
account_tier = "Standard"
account_replication_type = "ZRS"
min_tls_version = "TLS1_2"
allow_nested_items_to_be_public = false
shared_access_key_enabled = false
lifecycle {
prevent_destroy = true # plan fails instead of deleting production data
}
}
// Pulumi in C# (Pulumi.AzureNative). State lives in the configured Pulumi backend.
using Pulumi;
using Pulumi.AzureNative.Resources;
using Pulumi.AzureNative.Storage;
using Pulumi.AzureNative.Storage.Inputs;
return await Deployment.RunAsync(() =>
{
var rg = new ResourceGroup("rg-orders-prod", new() { Location = "australiaeast" });
var storage = new StorageAccount("stordersprod", new()
{
ResourceGroupName = rg.Name,
Kind = Kind.StorageV2,
Sku = new SkuArgs { Name = SkuName.Standard_ZRS },
MinimumTlsVersion = MinimumTlsVersion.TLS1_2,
AllowBlobPublicAccess = false,
AllowSharedKeyAccess = false,
}, new CustomResourceOptions { Protect = true }); // like prevent_destroy
return new Dictionary<string, object?> { ["storageAccount"] = storage.Name };
});
azurerm backend with Entra auth, blob-lease locking, versioning and soft delete.existing.pulumi preview in the PR.actionOnUnmanage.The real cost difference is operational. Bicep pushes state onto Azure: ARM holds the live resources and deployment history, so there is nothing to back up, lock or repair. Terraform, OpenTofu and Pulumi make you run state as a production system:
moved blocks, adopting existing resources needs import, and a corrupted or stale state means restoring a blob version and reconciling by hand.That cost is worth paying when one tool must manage Azure plus GitHub, DNS and monitoring, and it is overhead when a team only deploys to Azure. Licensing is a procurement question, not an engineering one: know the facts (BSL since August 2023, IBM since February 2025, OpenTofu under the Linux Foundation and CNCF) and let policy decide between Terraform and OpenTofu.
Whatever you choose, standardise: one tool per layer, shared modules (Azure Verified Modules exist for both Bicep and Terraform), the same preview-and-approve pipeline, and drift checks on a schedule.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| Bicep (+ stacks) | Azure-only, app teams own infra | Azure-only skills | Many non-Azure resources |
| Terraform | Multi-provider platform teams, existing HCL estate | State operations, BSL review | Small Azure-only teams |
| OpenTofu | As Terraform, with OSI licence requirement | Same state cost, smaller vendor ecosystem | You rely on HCP Terraform features |
| Pulumi | Strong C# team, generated or highly repetitive infra | Backend, code-review discipline | Teams new to IaC |
Measure the choice by lead time for an infrastructure change, plan duration, failed-apply rate, and hours spent on state or drift repair per quarter.
Infrastructure as code (IaC) means the cloud resources an app needs (App Service, Azure SQL, Key Vault, role assignments) are described in version-controlled files and created by a tool such as Bicep or Terraform, not by clicking in the portal. Good IaC is declarative (you describe the desired end state and the tool works out the API calls) and idempotent (running it again changes nothing if nothing changed). That gives you repeatable environments, a reviewable history in Git, and a way to rebuild after a disaster.
what-if or terraform plan shows it.The trade-off: IaC costs learning time and discipline (no more "quick fixes" in the portal), but it is the only way to keep more than one environment consistent.
I create a user-assigned managed identity first, then a Key Vault with enableRbacAuthorization: true, an Azure SQL server with Entra-only authentication (no SQL admin password), and a Container App that runs as that identity. Access is granted with Microsoft.Authorization/roleAssignments resources whose names are guid(scope, principalId, roleId), so redeployments are idempotent. The app receives AZURE_CLIENT_ID and a password-less connection string, and DefaultAzureCredential does the rest.
.bicepparam files.az deployment group what-if.The trade-off: Bicep handles the Azure control plane well, but it cannot create the SQL database user (a data-plane action), so a pipeline step runs CREATE USER ... FROM EXTERNAL PROVIDER.
My rule is to remove secrets rather than protect them. The pipeline authenticates to Azure with OIDC / workload identity federation: the CI platform issues a short-lived token that Entra trusts, so no client secret is stored. The app authenticates to SQL, Storage and Key Vault with managed identity. Remaining secrets (third-party API keys) live in Key Vault; the pipeline deploys only a Key Vault reference such as @Microsoft.KeyVault(VaultName=...;SecretName=...) as an app setting, and the platform resolves it with the app's identity, so the value never passes through the pipeline.
Pipeline identities are least privilege: one per environment, roles on a resource group, protected by environment approvals. Secret scanning with push protection blocks committed secrets.
If a secret leaks, I revoke and rotate first, then clean logs, then check access logs. The trade-off is up-front identity setup in exchange for nothing worth stealing in the pipeline.
How to tell it (STAR)
**S:** At [company] we had [about 30] services on Azure with three different ways of creating infrastructure and an audit coming in [timeframe]. **T:** I was asked to [lead / contribute to] choosing one approach without stopping delivery. **A:** I inventoried resources with Resource Graph, measured drift with what-if and plan, and listed what was outside Azure. That showed app teams only needed Azure, while the platform team also managed GitHub and DNS, so we chose Bicep with deployment stacks for services and [OpenTofu / Terraform] for the platform layer, wrote an ADR, and built one pipeline template with previews and approval on deletes. **R:** Within [a quarter], [X%] of production resources were in code, drift findings dropped from [N] to [near zero], and the audit closed the change-management finding.
Last updated 23 Nov 2026.