Bicep Fundamentals
Author readable Azure infrastructure with Bicep, a clean DSL that compiles to ARM.
Bicep is a domain-specific language for deploying Azure resources. It’s a clean, typed layer over ARM templates — far more readable than ARM JSON, with no state file to manage (Azure tracks deployment state for you).
Core elements: param (inputs), var (computed values), resource
(what to deploy), output (returned values), and modules for reuse. Bicep
transpiles to ARM JSON, so anything ARM can do, Bicep can — with much less
ceremony. Deployments are idempotent.
param location string = resourceGroup().location
param storageName string
resource sa 'Microsoft.Storage/storageAccounts@2023-01-01' = {
name: storageName
location: location
sku: { name: 'Standard_LRS' }
kind: 'StorageV2'
}
output storageId string = sa.idaz deployment group what-if -g rg-demo -f main.bicep -p storageName=stdemo01
az deployment group create -g rg-demo -f main.bicep -p storageName=stdemo01 - Identify the Bicep equivalents of inputs, variables, resources, and outputs.
- Write a Bicep resource for a storage account with a parameterized name.
- Explain why Bicep needs no separate state file.
- Use
what-if(in words) to preview a deployment.
Cheat Sheet▾
| Element | Keyword |
|---|---|
| Input | param |
| Computed value | var |
| Resource | resource … '<type>@<api>' |
| Output | output |
| Reuse | module |
| Preview | az deployment group what-if |
| Deploy | az deployment group create |
Common Interview Questions▾
What is Bicep and how does it relate to ARM?
A concise DSL for Azure IaC that transpiles to ARM JSON. It offers the same capabilities with far better readability, modules, and tooling, and no separate state file.
Does Bicep have a state file like Terraform?
No. Azure Resource Manager tracks deployed resources, so there’s no state file to store or lock — you deploy templates and ARM reconciles to the desired state.