Skill 3.1.3

Modify an existing Bicep file

Key Concepts

In Bicep, a new parameter is a single line such as param location string = resourceGroup().location, a constraint is a decorator such as @allowed(['Standard_LRS', 'Standard_GRS']), and a resource property uses the parameter by name. Loops use [for i in range(0, count): {...}], conditional deployment uses if (deployVpn) before the resource body, and an existing resource is referenced with the existing keyword. Child resources can be nested or declared with the parent property.

Modules (module stg './storage.bicep' = {...}) split a deployment into reusable files and can target another scope. Values for each environment go in a .bicepparam or JSON parameter file. The Bicep extension for Visual Studio Code provides validation, IntelliSense and type information for every resource type and API version.