5 Cool Things About Azure Bicep Templates

5 Cool Things About Azure Bicep Templates

This should really be called everything I know about Biceps I learned from Adil Islam’s webinar.

I’ve been familiar with the basics of Infrastructure as Code, mostly through AWS Cloud Formation. So I was excited/terrified to learn about all the advantages you can get when using Azure Bicep when compared to just JSON-based Azure Resource Manager templates aka ARM templates (cue the upper body workout jokes / Arnold-Carl Weathers memes).

As I mentioned, Adil Islam ran a fun-to-watch webinar (with included GitHub repo) where he explains the background of standard ARM vs Bicep templates and walks you through creating some basic resources. Without further delay, here are five nice takeaways from his session.

What is Bicep?

Microsoft says, “Bicep is a domain-specific language (DSL) that uses declarative syntax to deploy Azure resources.” Bicep simplifies the authoring experience you have with Resource Manager templates. Bicep is used only within the Azure ecosystem and is supported directly by them. This leads to some cool advantages:

1. Bicep templates can be half the size (or less) of JSON-based ARM templates.

Yes, this part is true — it all just depends on what you have included, of course. But you can definitely see size reduction — and a big part of it is due to Bicep’s structure. Standard ARM templates are JSON-based and Bicep templates are formatted more like YAML files with more readable headers and bodies.

Bicep vs ARM template size

2. Bicep supports new Azure services immediately

Getting access to supporting new Azure services immediately makes Bicep equally as useful as ARM templates and ahead of third-party Infrastructure-as-Code tools such as Terraform.

3. Bicep has its own CLI

The Bicep CLI is super easy to install, and along with whatever IDE you want you’ll have a quick way to get started experimenting with Bicep templates.

4. Bicep is not a panacea, especially if you have lots of huge legacy templates

Many organizations will probably have huge legacy ARM templates with all sorts of nested options and dependencies. Choosing whether to convert these to Bicep is going to be a business decision because there will be time-consuming errors when you go through the process. It may be better to just use Bicep for new templates. Adil’s webinar shows a flowchart he created to help make such a decision.

Flowchart - Converting ARM to Bicep templates

5. Expect errors when you convert from ARM to Bicep

Note that Azure mentions that there is no guaranteed mapping from ARM-to-Bicep templates. Adil walks you through his process to debug the expected conversion errors and figure out if they’re problems on your side or on Azure’s end.

Azure Bicep Issues on GitHub

Want to see a Bicep conversion in action?

Check out Adil Islam’s webinar below.

Cloud Academy