The State of Azure IaC

Microsoft Azure IaC Project Bicep

If you’ve never heard of the Microsoft Infrastructure-as-Code platform I don’t blame you. Building IaC templates for Azure didn’t start out too well.

During Build 2014, Microsoft introduced ARM or Azure Resource Manager. With new APIs at their disposal, customers now had the ability to build their Azure Infrastructure using Infrastructure-as-code templates.

The platform is based on JSON files that in a declarative way, allow you to write what kind of resources you want to deploy to your Azure Cloud.

Since launching, the adoption of ARM templates hasn’t been that great. Unless you are an experienced developer or really good at JSON and Azure Infrastructure in general, most people struggle to deal with the complexity of ARM templates.

Since many IT admins aren’t too familiar with the APIs and IaC templates, it’s a tough ask trying to get them to migrate from building on-premises environments to building cloud environments.

Another stumbling block is verifying deployments. Here are a couple reasons why:

  1. Azure doesn’t have a central dashboard that you can refer to.
  2. No multi-cloud support.

This is one of the major reasons why Terraform and Pulumi had so much success in the IaC space. With them, you can build for multi-cloud with easy to use and simple syntax.

This made customers choose Terraform or Pulumi among others when the subject is building IaC on Azure, or in a multi-cloud environment.

That is when Project Bicep came to life…

Project Bicep is a new, open-source project from Microsoft to fix most of the issues with ARM; making it better and open (available on GitHub) to whoever wants to build infrastructure-as-code in Azure.

In short and according to the Bicep GitHub repository, “Bicep is a Domain Specific Language (DSL) for deploying Azure resources declaratively.

The main idea is to simplify how you deploy resources in Azure. Since the old and traditional method (ARM or Azure Resource Manager) was too difficult for most people to understand.

The project is in version v0.3.126 at the moment of writing this article and hasn’t reached its mature state yet.

The idea is to move customers from building just ARM templates to building Bicep templates, thus simplifying how the templates are built, drastically decreasing the learning curve for new people getting started with Microsoft IaC, plus: It is open-source ❤️.

Bicep simplifies a lot of the complexity of building IaC templates, especially for non-developers. Take this output resource property, where the idea is to return information about the resource you created in your template.

In native ARM it will look like this:

"outputs": {
"hostname": {
"type": "string",
"value": "[reference(resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))).dnsSettings.fqdn]"

PS: I got lost with the amount of parenthesis and brackets here…

Microsoft Azure IaC Project Bicep

Using Bicep, you only need to write this line:

output hostname string =

A lot simpler right?

Microsoft Azure IaC Project Bicep

One of the cool things that Bicep is doing is keeping the backward compatibility of your old ARM templates.

The team behind Bicep created a transpile. This transpile essentially converts native ARM template files to the new bicep files with the simplified syntax. This makes it simpler to read and in smaller file sizes as well.

They’ve integrated this transpile in a multiplatform CLI tool available for Windows, Mac, Linux and also directly in the Azure CLI tool. Now, you can not only use the transpile to transform Native ARM files to Bicep files by using bicep decompile (ARM file), but also build ARM files based on your new bicep files by using bicep build file.bicep, which will generate an ARM file based on your Bicep file to deploy in your Azure infrastructure.

Another cool feature is if you want to build these templates using VS Code is an extension that’ll help you with validation and IntelliSense. This extension provides “Code Assist” or “Code Hinting” for the resource and parameters that you have in your templates.

Microsoft Azure IaC coding.

If you’re as excited as I am, visit the project page on GitHub:

They have a great tutorial to help you get started on your move from ARM templates to Bicep, or just to start with Bicep from scratch. Another great way to get started with Bicep is through the Bicep Playground, where you can try many samples that the Azure team has made available and also try to build and test your own code.

One of the members of the Bicep team is Brendand Burns, one of the co-founders of Kubernetes. This gave me some confidence that this open-source project will continue to evolve over time and become a great tool for Azure builders and help drive innovation for IaC technology in general.

The true story here is that only time will tell if the Azure team will “crack the code” on how to build great developer tools for builders. One thing I can say though is that they’re off to a great start.

What are your thoughts? Share your opinion below!

Join the Community

We’re building a community for people serious about succeeding in the cloud.