Getting started¶
Install and verify¶
Install Azure CLI, VS Code, and the Bicep extension. The editor provides completion, resource types, diagnostics, and navigation. Azure CLI's managed Bicep installation is separate from the editor.
az version
az bicep install
az bicep version
Compilation requires no login. Use the supported current CLI; this project's workflow records the Bicep version it actually tested.
Download the repository ZIP or clone it:
git clone https://github.com/brown9804/Bicep-Overview.git
cd Bicep-Overview
Inspect the first source¶
targetScope = 'subscription'
@description('Name of the dedicated learning resource group.')
@minLength(1)
@maxLength(90)
param resourceGroupName string = 'rg-bicep-overview-dev'
@description('Approved Azure region for the group; deployment metadata has its own region.')
param location string = 'eastus2'
@description('Non-sensitive ownership and purpose tags.')
param tags object = {
purpose: 'bicep-overview'
environment: 'dev'
}
resource group 'Microsoft.Resources/resourceGroups@2025-04-01' = {
name: resourceGroupName
location: location
tags: tags
}
@description('Management-plane ID of the group.')
output resourceGroupId string = group.id
@description('Resource group name for follow-on deployments.')
output resourceGroupName string = group.name
targetScope makes this a subscription deployment. Parameters describe caller
choices; decorators provide documentation and bounds. The resource declaration
specifies a type/API version, and outputs expose results.
The symbolic name group is a code reference, not the Azure resource name.
Compile offline¶
az bicep build --file examples/01-resource-group/main.bicep --stdout
Expected: ARM JSON with a subscription deployment schema, parameter definitions,
one resource-group resource, and outputs. No resource has been created.
Without --stdout/--outfile, build writes a JSON file beside the source;
CI writes generated output under ignored build/.
Next step¶
First read fundamentals and language. For optional live use, the resource-group example includes validation, what-if, creation, verification, and cleanup. It requires explicit Azure authorization and may fail due to policies/permissions that compilation cannot evaluate.
Exercise: change the group-name default and compile again. Identify the changed parameter default in JSON, and explain why this has not renamed a real group.