Currently, you have 3 options to describe your infrastructure in Azure:
- Json ARM Templates
- Bicep files
- Terraform files
All of them will do the job, but what would the pros and cons of which of them?
The Json ARM Templates are the original format for Azure IaC. There's probably more material on the Internet on how to get things done in this format. However, the original structure is lengthy and not so powerful and is more and more used as IL.
Bicep files are the way to go for new Azure IaC projects. It's a cleaner and more expressive language than JSON and supports all Azure resources. However, before deployment, you still need to compile them to ARM Templates in json format.
Finally, for those already familiar with Terraform, you can still use this template format, so you don't need learn one more template language :)
In a Bicep file, child resources can be declared within the nested scope of the parent resource, or outside the scope of the parent resource. Learn how in the following article by @choudhari_manoj#SRE