What is Bicep 💪 ?

Years back when I learned about Infrastructure as a Code for the first time I was amazed. My dreams of fully automating infrastructure deployment come true. I have been trying to learn more about developing ARM Templates, but I failed to find enough eagerness to work with JSON templates on a daily basis. I tried to automate infrastructure using Azure PowerShell, I even started learning Pulumi as I thought it would be great because of my familiarity with C#.

Infrastructure as Code

Then I found Terraform. I was surprised by how well it works, and I quickly started using that every time I had an opportunity – it was even a part of my Master's thesis! I've been developing my modules to create reusable templates to enforce cloud infrastructure standardization. By going through Terraform documentation, I found many new features of Azure Services I was not aware of before. I was kind of reverse learning Azure – checking what are the options or features available in Terraform and then going back to the documentation to learn more about them. Sometimes Terraform was not enough because it does not cover 100% of Azure ARM API. And then…

Bicep? What is it?

I have been following John Savill for a while already. I watched all of his certification preparation videos to finally get Azure certified. Suddenly he tweeted…

Then I read it natively support (only about people) (only about people) all types and API versions – amazing, exactly what I was looking for.

The reason that Microsoft started developing Bicep is to reduce complexity and improve Infrastructure as a Code development experience compared to ARM templates. Bicep is just an additional layer that converts declarative code to native ARM templates without you needing to deal with JSON complexity.

var cloudoingdemo = 'Hello!'
Variable declaration in Bicep 💪
"variables": {
  "cloudoingdemo": "Hello!"
},
Variable declaration in JSON

The bicep is not going to replace ARM templates anytime soon. Bicep compiles to JSON and the JSON is sent to Azure for deployment.

Bicep deployment process

One of the biggest improvements over Terraform is that Bicep does not require any state file. No more looking for the right place to store a state file and making sure it is secure (because a state file is a plain text… including secrets… did you know?). Bicep uses the native Azure state, therefore there is no need to care about it.

Are you familiar with Terraform modules? Bicep does it as well. Adding to that very good development experience when you are using VS Code makes it competitive.

Remember to install "Bicep" VS Code extension to see IntelliSense options

Do I still use Terraform? Yes. Will I switch completely to Bicep? No, at least not yet. Terraform is still the Infrastructure as a Code tools leader (unofficial) industry standard, with a great and supportive community. However, I will try to develop more in Bicep to familiarize myself with a native Azure Infrastructure as a Code tool.

Do you agree or disagree? Let me know in the comments below.

Thanks!

You've successfully subscribed to Cloudoing
Great! Next, complete checkout to get full access to all premium content.
Error! Could not sign up. invalid link.
Welcome back! You've successfully signed in.
Error! Could not sign in. Please try again.
Success! Your account is fully activated, you now have access to all content.
Error! Stripe checkout failed.
Success! Your billing info is updated.
Error! Billing info update failed.