Bicep is a Domain Specific Language (DSL) for deploying Azure resources declaratively.
"Why not focus your energy on Terraform or other third-party IaC offerings?" ' Using Terraform can be a great choice depending on the requirements of the organization, and if you are happy using Terraform there is no reason to switch. At Microsoft, we are actively investing to make sure the Terraform on Azure experience is the best it can be.' - Please check the reference here
- Good to read - https://github.com/azure/bicep
- Bicep playground - https://aka.ms/bicepdemo
- ARM to Bicep - select decompile button in bicep playground to change ARM template to Bicep file
bicep decompile .\main.json
(https://e2esolutionarchitect.com/helpline/)
Assuming Azure CLI is already installed
az bicep install
az bicep version
Install Bicep extension in VSCode click here
# It will generate .json file. Which can be deployed as ARM template.
az bicep build --file main.bicep
Debug
az deployment group create --resource-group <resource-group-name> --template-file ./modules/compute/vmLinux.bicep --parameters ./params/dev/vmLinux.bicepparam --verbose --debug
# Deploy ARM template
az deployment group create -f main.json -g <resource-group-name> -c
# Deploy Bicep
az deployment group create -f main.bicep -g <resource-group-name> -c
# Using parameter file
az deployment group create -g rg-dev -f main.bicep --parameters ./parameters/main.dev.bicepparam -c
# Deploy using subscription
az deployment sub create -l eastus -f main.bicep
# Using parameter file
az deployment sub create -l eastus -f rg.bicep --parameters ./parameters/rg.dev.bicepparam -c
Run below command to remove the resource group. Deleting the resource group will delete all the resources under the resource group. You do not need to terminate resources individually
# Azure CLI
az group delete --name ExampleResourceGroup
# PowerShell
Remove-AzResourceGroup -Name ExampleResourceGroup
Please visit https://e2esolutionarchitect.com. Feel free to write us for any queries to som@e2eSolutionArchitect.com