Skip to content

Latest commit

 

History

History
100 lines (68 loc) · 3.34 KB

learn-bicep.md

File metadata and controls

100 lines (68 loc) · 3.34 KB

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'