Bicep vs Terraform – Let's settle this (for now)
This post by Juuso Saranki was originally published on his own blog on 13 November 2026. Read the original post on Juuso's blog.
Ever since I started working with Bicep, I've mostly heard two questions:
- Is it any good?
- Is it better than Terraform?
For years, my answer was simply that it's good and about as simple as it gets if your goal is to make repeatable deployments, but it kind of sucks if you want to keep the source of truth of your infrastructure in a repository. The main reason for this was that if you removed resources from a Bicep template, you'd still need to manually delete them from Azure when using traditional incremental deployments. I started my IaC journey with Terraform, so for me, that was always a big bummer. Removing a resource from your code should also remove it from Azure, right?
Another thing that has historically been a bit of a pain point has been what-if and its inaccuracy. There have been noise issues, and sometimes what-if has given you the impression that everything is fine, only for the actual deployment to fail because of missing parameters or some other validation issue. Of course, no preview tool can guarantee a successful deployment, but it hasn't always been a particularly confidence-inspiring experience.
For many of these issues, there have been workarounds, such as running additional validation or cleanup scripts in deployment pipelines, but that's not really something that works out of the box.
Where are we now?
I wrote some weeks ago that deployment stacks finally have a proper what-if. We also have Bicep snapshots generally available now, allowing us to compare changes offline against a previously saved snapshot. I think it's finally fair to start a real comparison between the two.
For simplicity, my main goal is to compare these tools from the perspective of deploying infrastructure to Azure, rather than discussing multi-cloud scenarios, since Bicep obviously won't fly there. I'll also look at some other Microsoft services that often come along with Azure deployments.
Now that we have deployment stacks with proper what-if support, one of Terraform's biggest historical advantages has become much less significant. Bicep can finally remove resources when we leave them out of our templates and show a preview of those deletions before deploying.
Yeah, yeah, but which one is better??
To answer that, first we must understand what we're trying to solve here. Our end goal should be to deploy resources for a solution (be it an application or a platform product, such as a landing zone) in a reasonably robust manner. What this actually means is that we want to cover the following areas:
- Ease of getting started: How easy is it for teams to learn the tooling and start managing infrastructure?
- Reasonable amount of testing and previewing changes: Can we validate changes locally and understand their effects before deploying to Azure?
- Source of truth and resource lifecycle management: Can we manage the complete resource lifecycle through code, including creation, updates, deletion, and configuration drift?
- Resource and platform coverage: Can we manage all the resources our solution requires, including those outside Azure Resource Manager?
- Operational overhead: How much additional infrastructure, configuration, and ongoing maintenance does the tool require?
- Deployment safety and predictability: Can we control potentially destructive changes, protect critical resources, and reliably deploy what we intended?
Let's compare each category and figure out a winner for each. It's good to understand that some categories carry a bit more weight than others. And every single category that has a winner will definitely have at least some fans of the other team arguing that "achtually, that's not exactly true since…" So the results aren't that black and white.
Ease of getting started
Well, I think this one is among the easiest categories to pick a winner for. Both tools have pretty good tooling available, and if you're using HCL with Terraform and the AzureRM provider, I don't think there's that much difference in how difficult it is to write the actual code (especially when it's most likely AI writing the code). The syntax is different, of course, but both are fairly easy to understand once you've learned the basics. The difference comes when you need to set everything up from scratch.
With Bicep, you can basically write your template and deploy it directly to Azure using the Azure CLI or PowerShell. If you're already familiar with Azure, you can use the same authentication methods and tooling you're probably already working with.
Terraform isn't particularly difficult to get started with either, especially if you're just experimenting locally. But when you're setting up a real deployment environment, things get a bit more complicated. You'll need to figure out where to store your Terraform state and make sure your environments have their own state configurations.
For an Azure-only team getting started with IaC, I think this gives Bicep a clear advantage.
Winner: Bicep
Reasonable amount of testing and previewing changes
When it comes to testing, Terraform still has the upper hand. It has a built-in testing framework called terraform test, which allows us to write actual test cases for our infrastructure modules, even without deploying resources by using mocked providers. Bicep also has validation tools like its built-in linter and PSRule for Azure, but its testing capabilities aren't quite as comprehensive.
Then again, I don't think we should necessarily approach infrastructure testing the same way as application testing. For many relatively simple Azure deployments, writing extensive unit tests might be a bit overkill. One of the most important things is still deploying to lower environments and verifying that everything actually works before moving to production.
When it comes to previewing changes, Terraform has historically had a big advantage with its plan command. However, Bicep's what-if has improved significantly, especially with deployment stacks, which can now preview resource deletions as well. Microsoft has also introduced noise reduction to deployment stack what-if, making the results easier to interpret. Terraform still has an advantage in being able to save and apply an approved plan, whereas Bicep's what-if is only a preview. Neither approach guarantees that the actual deployment will succeed, though.
Bicep also recently introduced snapshots, which allow us to compare the infrastructure described by our code against a previously saved snapshot completely offline, without Azure permissions. This is particularly interesting for AI-assisted development, where we can validate changes without giving agents access to Azure. However, snapshots don't compare against actual Azure resources, so they don't replace what-if. Terraform can also perform offline tests using mocked providers, although the approach is different.
Winner: Terraform, mainly because of its more mature testing capabilities and saved plans. But for typical Azure deployments, Bicep is getting pretty close.
Source of truth and resource lifecycle management
This, for me, was the biggest reason for selecting Terraform over Bicep for so many years. In my ideal IaC setup, the infrastructure managed by my IaC tool should reflect the desired configuration defined in my repository. If I, for example, remove a storage account from the code and deploy the changes, that storage account should also disappear from Azure.
With traditional incremental Bicep deployments, this wasn't the case. Complete mode could handle resource deletions at the resource-group scope, but it wasn't the same as managing the lifecycle of resources explicitly owned by a deployment. Terraform has been able to handle this through its state management pretty much since day one.
Now that we have deployment stacks, this is finally possible with Bicep as well. When a resource is removed from the template, the deployment stack can delete it from Azure instead of just leaving it there.
Of course, neither tool guarantees that the actual Azure environment always matches the repository. Somebody can still make changes manually through the Azure portal, for example, so you'll need proper access management in place. Both Terraform and Bicep's what-if can help identify configuration drift in managed resources. Deployment stacks can also help prevent unwanted changes through Azure-native deny assignments, although these protections have their own limitations.
Terraform uses its state to keep track of the resources it manages, while Bicep deployment stacks maintain their resource ownership information in Azure. The approaches are different, but both can now provide the resource lifecycle management I'm looking for when working with ARM resources.
There are still some resource-specific limitations with deployment stacks, but for the usual Azure infrastructure scenarios, I think it's fair to call this a tie.
Winner: Tie (for ARM resources)
Resource and platform coverage
This is where Terraform still wins, since Bicep is primarily built around Azure Resource Manager deployments, even though there's now support for some Microsoft Graph / Entra ID resources as well.
I'll split this into three main categories.
1. Azure Resource Manager (ARM)
Both have practically equivalent coverage here, so there's no clear winner.
One thing worth mentioning is that Terraform's AzureRM provider doesn't necessarily support every new Azure resource or API version immediately. However, you can use the AzAPI provider to manage ARM resources that aren't yet available in AzureRM.
Bicep can also target ARM resource types and API versions directly, so I don't think resource coverage should be a deciding factor when deploying standard ARM infrastructure.
2. Entra ID / Microsoft Graph API
Bicep support for Microsoft Graph has gotten better, and you can already do things like creating users, groups, application registrations, and service principals. But if you need to work with more advanced identity governance services, such as Privileged Identity Management, access packages, or Conditional Access policies, you'll quickly run into limitations with the official Bicep Graph extension.
The common way of bypassing these limitations has been running PowerShell or other scripts in deployment pipelines. But since we're comparing the experience offered by these tools and their supported providers, Terraform definitely wins here. Terraform's AzureAD provider supports a much broader set of Entra ID resources, and Microsoft's Graph Terraform provider extends the available options even further, although that provider is still in preview.
Another important thing to mention is that Microsoft Graph resources deployed through Bicep can't be managed through deployment stacks or previewed with what-if. So even for the Entra ID resource types that Bicep supports, we don't get the same lifecycle management experience as with ARM resources.
3. Other applications that often go together with Azure
There are quite a few Microsoft services that commonly go along with an Azure setup. Some examples are Azure DevOps, Microsoft Fabric, Power Platform, and Dynamics 365. We can also include GitHub and services like Azure Databricks.
Terraform has established providers for many of these services, which allow us to manage resources that aren't available through ARM. For example, Bicep can deploy a Fabric capacity through ARM, but managing things like Fabric workspaces, lakehouses, or notebooks is a different story. Terraform has a dedicated Fabric provider for these resources.
The same applies to Azure DevOps projects, repositories, and service connections, or Power Platform environments and other supported configurations.
Kubernetes is another example. Both tools can provision AKS clusters, but Terraform also has Kubernetes and Helm providers for managing resources inside the cluster. Then again, Kubernetes workloads are commonly managed separately using Helm or GitOps tools like Flux and Argo CD, so I wouldn't consider this a particularly strong Terraform advantage by itself.
It's worth noting that experimental and community-created Bicep extensions exist for some non-ARM services, so saying that Bicep cannot manage them at all wouldn't be correct. However, these aren't yet comparable to Terraform's more established provider ecosystem.
Clear winner: Terraform, although it obviously depends on what you're deploying.
Operational overhead
Everyone who has worked with Terraform knows that working with state files can be a bit painful from time to time. Like said before, first, you'll need to figure out where to store the state. Then you need to decide how to separate states between environments or solutions, handle imports of existing resources, and occasionally deal with locking or state-related issues.
To be fair, Terraform's remote state management is mature and generally works very well when configured correctly. It's not like state files are constantly getting corrupted or you need to manually fix locks every other day. But it's still something you need to configure and maintain.
Bicep's clearest selling point is that there's no Terraform-style state file to manage. Azure Resource Manager handles the actual resources, and deployment stacks keep track of the resources they manage within Azure.
That doesn't mean Bicep has absolutely no operational overhead. You still need to manage deployment stacks, their permissions, scopes, and deletion behavior. There can also be situations where stacks get out of sync with the resources they're managing. But at least you don't need to maintain a separate state backend.
If you're deploying resources that fit nicely into deployment stacks, I think Bicep is a clear winner here. If you need additional scripts or separate tools for resource types that Bicep doesn't support, that advantage gets smaller.
Winner: Bicep
Deployment safety and predictability
This is another interesting category, since both tools have their own ways of making deployments safer. Terraform has an advantage with its saved plans. You can generate a plan, review and approve it, and then apply that specific plan instead of generating a completely new one during deployment.
Terraform also has lifecycle settings such as prevent_destroy, which can prevent accidentally destroying a resource while that protection remains in its configuration. One important limitation, though, is that this protection no longer applies if you remove the entire resource definition from the configuration.
Bicep deployment stacks have their own interesting safety features. You can configure deny settings, such as denyDelete or denyWriteAndDelete, to protect managed resources against unwanted changes or deletions outside the intended deployment workflow.
This is actually quite a nice feature, especially when you want to prevent people from accidentally modifying infrastructure through the Azure portal.
Of course, Azure RBAC, resource locks, and Azure Policy are also available (AND SHOULD BE CONSIDERED ANYWAY!) regardless of whether you're using Bicep or Terraform.
In the end, neither tool automatically guarantees safe deployments. You still need proper permissions, approvals, testing, and deployment pipelines. And you probably shouldn't allow either tool to delete your production infrastructure without reviewing the changes first.
Terraform has the stronger saved-plan workflow, while Bicep deployment stacks provide useful Azure-native protection mechanisms.
For Azure-focused deployments, I think both can provide a sufficiently safe and predictable setup when configured properly.
Winner: Tie
Conclusion
When comparing the two tools, it pretty much comes down to what you're planning to use them for.
If my goal was to deploy only ARM resources, I would personally choose Bicep over Terraform for a new project. Mainly because of the ease of use, not having to worry about state files, and the fact that deployment stacks now provide the resource lifecycle management that I was previously missing.
But if your solution needs to deploy additional Entra ID resources that Bicep doesn't support, or resources in services such as Azure DevOps, Fabric, or Power Platform, Terraform starts to make a lot more sense. Its broader provider ecosystem allows you to manage more of the solution using the same tooling.
In reality, if you're running a large Azure environment, you're most likely going to have separate repositories and pipelines for different solution areas, such as identity management and landing zones. So there's also a good chance that you can mix both tools.
For example, you could have your identities created with Terraform and your landing zones or networking resources created with Bicep. The important thing is that both tools have clear ownership of the resources they manage, so you don't end up with conflicting deployments.
Bicep has finally reached a point where I think it's worth seriously considering as the default for Azure-native infrastructure. Terraform still has clear advantages, but these are increasingly about the wider ecosystem rather than basic Azure resource deployments.
Originally published on juusosaranki.com.
About the author
Juuso Saranki
Juuso works at Polar Squad and writes about Azure, infrastructure as code, AI and automation.
