Bicep is a domain-specific language (DSL) for deploying Azure resources using declarative Infrastructure-as-Code (IaC). Bicep simplifies ARM template authoring with cleaner syntax, better tooling, and improved type safety. Unlike verbose JSON, Bicep provides concise, readable resource definitions while compiling to ARM templates transparently. The key insight: Bicep uses symbolic names instead of string-based resource IDs, enabling strong type checking and IntelliSense — this makes cross-resource references natural and safe, drastically reducing deployment errors compared to traditional ARM JSON.
What This Cheat Sheet Covers
This topic spans 17 focused tables and 151 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Core Language Syntax
| Element | Example | Description |
|---|---|---|
resource stg 'Microsoft.Storage/storageAccounts@2023-01-01' = { ... } | • Declares an Azure resource with a symbolic name, type, API version, and properties • symbolic name enables strongly-typed references throughout the file. | |
param location string = 'eastus' | • Declares an input parameter with type and optional default • accepts values at deployment time for flexibility across environments. | |
var storageName = 'mystg${uniqueString(resourceGroup().id)}' | • Compile-time variable that simplifies expressions • reduces duplication and improves readability. | |
output storageId string = stg.id | • Returns a deployment value • passes data to calling templates or displays results post-deployment. | |
module myModule './module.bicep' = { params: { ... } } | • References another Bicep file for reuse • encapsulates logic and promotes modular infrastructure design. |