In this article, let’s have a look at what is Azure Bicep, why it is used and which tools are required in order to setup the development environment.
What is Azure Bicep ?
Infrastructure as a code is one of the practices which are strongly recommended now a days. Infrastructure as code implies automating creation of infrastructure by writing code, so that same infrastructure with same configurations can be created each and every time, quickly and in consistent manner.
There are various languages and tools which are used for creating infrastructure for the applications. One of the commonly used tool is PowerShell script for providing infrastructure. There are some other free / proprietary tools in the market which can be used for this purpose.
Various cloud platforms use different tools and languages. Azure provides a consistent approach for accessing infrastructure related APIs – via Azure Resource Manager. Azure Resource Manager (aka ARM) provides a consistent way to create / modify and manage the Azure Resources.
Azure Resource Manager is internally used by Azure PowerShell module, and Azure CLI. In addition to these tools, there are ARM templates which can be used to create / modify infrastructure in Azure.
Till now, now, we have covered what is Infra as code, and what is ARM, but we still have not started discussing about Azure Bicep. So what is Azure Bicep ?
As per documentation,
Bicep is a domain-specific language (DSL) that uses declarative syntax to deploy Azure resources. In a Bicep file, you define the infrastructure you want to deploy to Azure, and then use that file throughout the development lifecycle to repeatedly deploy your infrastructure.
Azure Docs
So it is a language, which has certain syntax. We can write some code to create / modify Azure services. It uses declarative syntax, that means we just need to tell what we need and it will automatically take care of sending appropriate instructions to make infrastructural modifications.
Where it can be useful ?
As already discussed, it is a language, which can be used to create code to manage infrastructure. It will help to ensure that required Azure services. It can be helpful to create the new environments needed for application(s) quickly and without making any mistakes.
This can be very helpful to spawn new environments. Also, it can be helpful for reducing application’s downtime, in case the infrastructure comes to an undesirable state, due to some “incidences”.
Azure Bicep – Features
As per my opinion, there are two major benefits:
- Lesser Typing: Bicep file is less verbose, it needs less typing than the JSON templates
- Easier to understand: Less lines of code to understand.
- Better tooling: Another major advantage is tooling for writing the code. Bicep comes with Visual Studio code plugins, which would certainly help in optimizing the time needed for writing the code
- Better Orchestration: If you want to create dependent resources, you do not need to worry about ensuring correct order based on dependencies. Resource manager correctly orders the interdependent scripts so we do not need to explicitly order them.
- Faster Deployments, Also, resource manager can deploy some resources in parallel, making the deployment run faster.
- Modularity, Bicep code can be split into multiple and easily manageable modules. These modules also enable better reusability.
- Free and Open Source, Bicep is free and open source and it is supported by Microsoft Support.
That’s it for the first introductory article. In the coming articles, we are going to have a look at tools and language syntax. I hope you find this information helpful. Let me know your thoughts.