Infrastructure as code is the process of automating your infrastructure provisioning. Bicep is a Resource Manager template language that's used to declaratively deploy Azure resources. This repository can be used to help get started deploying resouces in Bicep.
- Microsoft Bicep Documenation
- Install Bicep Tools
- MS Learning Modules
- Deploy With AZ CLI
- Deploy With Powershell
Azure control plan manages requests sent by client interface (Powershell, Azure CLI, RestApi, Or Portal). When the request is sent the Azure Resource Provider takes the request action. The control plane handles what resources need to be created and which already exist. Since the resource manager understands the current environment, it wont create identical resources or delete existing resoruces.
Bicep takes the configuration and converts it to an ARM resource template. ARM is used as an intermediate language used to submit the converted bicep file to the Resource Manager
az deployment group create --resource-group <resource-group-name> --template-file <path-to-bicep>
az deployment sub create --location <location> --template-file <path-to-bicep>
az deployment mg create --location <location> --template-file <path-to-bicep> --management-group-id <MG_GroupID>
az deployment mg create --location <location> --template-file <path-to-bicep>
This will output a ARM Template JSON File from an bicep file.
az bicep build --file main.bicep
This will take an existing ARM Template and convert it to Bicep. This will attempt to convert but does not guaranteed mapping from ARM template json to bicep. MSFT Documentation
az bicep decompile --file main.json