šŸ’ŖAzure Bicep: working with Parameters ā€” Best practices

Dave R - Microsoft Azure & AI MVPā˜ļø
CodeX
Published in
6 min readSep 22, 2021

--

When and how should you use parameters in your Azure Bicep templates.

In Azure Bicep, the new domain-specific language (DSL) to declarative deploy Azure resources, we define parameters just as we did in ARM templates. There are a few differences in the syntax we should consider.

Azure Bicep ā€” Parameters

Parameters in Azure Bicep

Parameters are input values we define in the Bicep template. These values can be passed on either inline during the deployment operation or referenced from a Parameters file.

Declaring parameters in Azure Bicep

You need to provide a name and type for each parameter in your Bicep template. The code below shows how to declare parameters:

param demoString string
param demoInt int
param demoBool bool
param demoObject object
param demoArray array

A parameter canā€™t have the same name as a variable, module, or resource. Donā€™t overuse parameters. Parameters are often utilized when we need to pass on values that need to vary for different deployments.

For example, when you create a storage account, you need to provide the SKU and type; you could leverage parameters.

--

--