Skip to content

Instantly share code, notes, and snippets.

@timothywarner
Last active May 14, 2023 11:59
Show Gist options
  • Save timothywarner/19217a7401e23d9e00da8839b13c0261 to your computer and use it in GitHub Desktop.
Save timothywarner/19217a7401e23d9e00da8839b13c0261 to your computer and use it in GitHub Desktop.
Azure Bicep Quick Start by Tim Warner (@TechTrainerTim)

Get Comfortable with Azure Bicep

Meta

Tools

Training

Common Bicep operations

Install Bicep CLI in Azure CLI

az bicep install

az bicep version

az bicep upgrade

Convert .bicep to .json

bicep build .\main.bicep --outfile .\arm-main.json

az bicep build --file .\main.bicep

Convert .json to .bicep

bicep decompile .\arm-main.json --outfile .\arm.bicep

az bicep decompile --file .\arm-main.json

Resource group deployments

PowerShell

New-AzResourceGroupDeployment -ResourceGroupName 'test-rg' -TemplateFile '.\main.bicep' -WhatIf

Azure CLI

az deployment group create --resource-group 'test-rg' --template-file '.\main.bicep'

Bicep PowerShell Module

Installation and discovery

Install-Module -Name Bicep -Verbose -Force

Update-Help -Force -ErrorAction SilentlyContinue

Get-Command -Module Bicep

Create JSON parameter file from a Bicep file

New-BicepParameterFile -Path '.\AzureFirewall.bicep' -Parameters All

Validate a Bicep file

PS C:\> Test-BicepFile -Path 'MyBicep.bicep' -AcceptDiagnosticLevel 'Warning'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment