Skip to content

Commit f4dd776

Browse files
Merge pull request #291033 from LiSeda/LS-createparams
LS_parameter-files.md
2 parents 94226d6 + c01fc1b commit f4dd776

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

articles/azure-resource-manager/bicep/parameter-files.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create parameters files for Bicep deployment
33
description: Create parameters file for passing in values during deployment of a Bicep file.
44
ms.topic: how-to
55
ms.custom: devx-track-bicep
6-
ms.date: 06/28/2024
6+
ms.date: 12/04/2024
77
---
88

99
# Create parameters files for Bicep deployment
@@ -13,7 +13,7 @@ Rather than passing parameters as inline values in your script, you can use a Bi
1313
> [!NOTE]
1414
> The Bicep parameters file is only supported in [Bicep CLI](./install.md) version 0.18.4 or newer, [Azure CLI](/cli/azure/install-azure-cli) version 2.47.0 or newer, and [Azure PowerShell](/powershell/azure/install-azure-powershell) version 9.7.1 or newer.
1515
16-
A single Bicep file can have multiple Bicep parameters files associated with it. However, each Bicep parameters file is intended for one particular Bicep file. This relationship is established using the [`using` statement](./bicep-using.md) within the Bicep parameters file.
16+
A single Bicep file can have multiple Bicep parameters files associated with it. However, each Bicep parameters file is intended for one particular Bicep file. This relationship is established with the [using statement](./bicep-using.md) within the Bicep parameters file.
1717

1818
You can compile Bicep parameters files into JSON parameters files to deploy with a Bicep file. See [build-params](./bicep-cli.md#build-params). You can also decompile a JSON parameters file into a Bicep parameters file. See [decompile-params](./bicep-cli.md#decompile-params).
1919

@@ -30,7 +30,7 @@ param <first-parameter-name> = <first-value>
3030
param <second-parameter-name> = <second-value>
3131
```
3232

33-
You can use the [using statement](./bicep-using.md) with Bicep file, ARM JSON templates, Bicep modules, and template specs. For example:
33+
You can use the [using statement](./bicep-using.md) with a Bicep file, Azure Resource Manager JSON templates, Bicep modules, and template specs. For example:
3434

3535
```bicep
3636
using './main.bicep'
@@ -76,7 +76,7 @@ using './main.bicep'
7676
param intFromEnvironmentVariables = int(readEnvironmentVariable('intEnvVariableName'))
7777
```
7878

79-
You can define and use variables. [Bicep CLI version 0.21.X or higher](./install.md) is required for using variables in .bicepparam file. Here are some examples:
79+
You can define and use variables. [Bicep CLI version 0.21.X or higher](./install.md) is required for using variables in .bicepparam files. Here are some examples:
8080

8181
```bicep
8282
using './main.bicep'
@@ -124,7 +124,7 @@ param environmentSettings = {
124124

125125
---
126126

127-
It's worth noting that the parameters file saves parameter values as plain text. For security reasons, this approach isn't recommended for sensitive values such as passwords. If you must pass a parameter with a sensitive value, keep the value in a key vault. Instead of adding the sensitive value to your parameters file, use the [getSecret function](bicep-functions-resource.md#getsecret) to retrieve it. For more information, see [Use Azure Key Vault to pass secure parameter value during Bicep deployment](key-vault-parameter.md).
127+
It's worth noting that the parameters file saves parameter values as plain text. For security reasons, this approach isn't recommended for sensitive values such as passwords. If you must pass a parameter with a sensitive value, keep the value in a key vault. Instead of adding a sensitive value to your parameters file, use the [getSecret function](bicep-functions-resource.md#getsecret) to retrieve it. For more information, see [Use Azure Key Vault to pass secure parameter value during Bicep deployment](key-vault-parameter.md).
128128

129129
## Parameter type formats
130130

@@ -190,19 +190,19 @@ Use Bicep syntax to declare [objects](./data-types.md#objects) and [arrays](./da
190190

191191
Bicep parameters file has the file extension of `.bicepparam`.
192192

193-
To deploy to different environments, you create more than one parameters file. When you name the parameters files, identify their use such as development and production. For example, use _main.dev.bicepparam_ and _main.prod.bicepparam_ to deploy resources.
193+
To deploy to different environments, you create more than one parameters file. When you name multiple parameters files, label their use as development and production. For example, use _main.dev.bicepparam_ for development and _main.prod.bicepparam_ for production to deploy resources.
194194

195195
# [JSON parameters file](#tab/JSON)
196196

197-
The general naming convention for the parameters file is to include _parameters_ in the Bicep file name. For example, if your Bicep file is named _azuredeploy.bicep_, your parameters file is named _azuredeploy.parameters.json_. This naming convention helps you see the connection between the Bicep file and the parameters.
197+
The general naming convention for a parameters file is to include _parameters_ in the Bicep file name. For example, if your Bicep file is named _azuredeploy.bicep_, then your parameters file is named _azuredeploy.parameters.json_. This naming convention helps you see the connection between the Bicep file and the parameters.
198198

199-
To deploy to different environments, you create more than one parameters file. When you name the parameters files, identify their use such as development and production. For example, use _azuredeploy.parameters-dev.json_ and _azuredeploy.parameters-prod.json_ to deploy resources.
199+
To deploy to different environments, you create more than one parameters file. When you name multiple parameters files, label their use as development and production. For example, use _azuredeploy.parameters-dev.json_ for development and _azuredeploy.parameters-prod.json_ for production to deploy resources.
200200

201201
---
202202

203203
## Define parameter values
204204

205-
To determine how to define the parameter names and values, open your Bicep file. Look at the parameters section of the Bicep file. The following examples show the parameters from a Bicep file called `main.bicep`.
205+
To determine how to define parameter names and values, open your Bicep file. Look at the **parameters** section of the Bicep file. The following examples show the parameters from a Bicep file named `main.bicep`:
206206

207207
```bicep
208208
@maxLength(11)
@@ -285,7 +285,7 @@ param storageAccountType = ''
285285

286286
---
287287

288-
Check the Bicep file for parameters with a default value. If a parameter has a default value, you can provide a value in the parameters file, but it's not required. The parameters file value overrides the Bicep file's default value.
288+
Check the Bicep file for parameters with a default value. If a parameter has a default value, you can provide a value in the parameters file, but it isn't required. The parameters file value overrides the Bicep file's default value.
289289

290290
# [Bicep parameters file](#tab/Bicep)
291291

@@ -314,11 +314,11 @@ param storageAccountType = '' // This value is optional. Bicep will use default
314314
```
315315

316316
> [!NOTE]
317-
> For inline comments, you can use either // or /* ... */. In Visual Studio Code, save the parameters files with the **JSONC** file type, otherwise you will get an error message saying "Comments not permitted in JSON".
317+
> For inline comments, you can use either // or /* ... */. In VS Code, save parameters files with the **JSONC** file type; otherwise, you'll get an error message that says, "Comments not permitted in JSON."
318318
319319
---
320320

321-
Check the Bicep's allowed values and any restrictions such as maximum length. Those values specify the range of values you can provide for a parameter. In this example, `storagePrefix` can have a maximum of 11 characters and `storageAccountType` must specify an allowed value.
321+
Check the Bicep file's allowed values and any restrictions such as maximum length. Those values specify the range of values you can provide for a parameter. In this example, `storagePrefix` can have a maximum of 11 characters, and `storageAccountType` must specify an allowed value.
322322

323323
# [Bicep parameters file](#tab/Bicep)
324324

@@ -347,27 +347,27 @@ param storageAccountType = 'Standard_ZRS'
347347
```
348348

349349
> [!NOTE]
350-
> Your parameters file can only contain values for parameters that are defined in the Bicep file. If your parameters file contains extra parameters that don't match the Bicep file's parameters, you receive an error.
350+
> Your parameters file can only contain values for parameters that are defined in the Bicep file. If your parameters file contains extra parameters that don't match the Bicep file's parameters, you'll receive an error.
351351
352352
---
353353

354354
## Generate parameters file
355355

356-
To generate a parameters file, you have two options: either through Visual Studio Code or by using the Bicep CLI. Both methods allow you to derive the parameters file from a Bicep file. From Visual Studio Code, See [Generate parameters file](./visual-studio-code.md#generate-parameters-file). From Bicep CLI, see [Generate parameters file](./bicep-cli.md#generate-params).
356+
You can create a parameters file two ways: either with VS Code or the Bicep CLI. Both tools allow you to use a Bicep file to generate a parameters file. See [Generate parameters file](./visual-studio-code.md#generate-parameters-file) for the VS Code method and [Generate parameters file](./bicep-cli.md#generate-params) for the Bicep CLI method.
357357

358358
## Build Bicep parameters file
359359

360-
From Bicep CLI, you can build a Bicep parameters file into a JSON parameters file. For more information, see [Build parameters file](./bicep-cli.md#build-params).
360+
From Bicep CLI, you can build a Bicep parameters file into a JSON parameters file. For more information, see [Build parameters file](./bicep-cli.md#build-params).
361361

362362
## Deploy Bicep file with parameters file
363363

364364
### Azure CLI
365365

366-
From Azure CLI, you can pass a parameter file with your Bicep file deployment.
366+
From Azure CLI, you can pass a parameters file with your Bicep file deployment.
367367

368368
# [Bicep parameters file](#tab/Bicep)
369369

370-
With Azure CLI version 2.53.0 or later, and [Bicep CLI version 0.22.X or higher](./install.md), you can deploy a Bicep file by utilizing a Bicep parameter file. With the `using` statement within the Bicep parameters file, there's no need to provide the `--template-file` switch when specifying a Bicep parameter file for the `--parameters` switch.
370+
You can deploy a Bicep file by using a Bicep parameters file with Azure CLI version 2.53.0 or later and [Bicep CLI version 0.22.X or higher](./install.md). With the `using` statement within the Bicep parameters file, there's no need to provide the `--template-file` switch when specifying a Bicep parameters file for the `--parameters` switch.
371371

372372
```azurecli
373373
az deployment group create \
@@ -467,17 +467,17 @@ New-AzResourceGroupDeployment `
467467

468468
---
469469

470-
For more information, see [Deploy resources with Bicep and Azure PowerShell](./deploy-powershell.md#parameters). To deploy _.bicep_ files you need Azure PowerShell version 5.6.0 or later.
470+
For more information, see [Deploy resources with Bicep and Azure PowerShell](./deploy-powershell.md#parameters). To deploy _.bicep_ files, you need Azure PowerShell version 5.6.0 or later.
471471

472472
## Parameter precedence
473473

474474
You can use inline parameters and a local parameters file in the same deployment operation. For example, you can specify some values in the local parameters file and add other values inline during deployment. If you provide values for a parameter in both the local parameters file and inline, the inline value takes precedence.
475475

476-
It's possible to use an external JSON parameters file, by providing the URI to the file. External Bicep parameters file is not currently supported. When you use an external parameters file, you can't pass other values either inline or from a local file. All inline parameters are ignored. Provide all parameter values in the external file.
476+
While external Bicep parameters files aren't currently supported, it's possible to use an external JSON parameters file by providing the URI to the file. When using an external parameters file, provide all parameter values in the external file since you can't pass other values either inline or from a local file, and all inline parameters are ignored.
477477

478478
## Parameter name conflicts
479479

480-
If your Bicep file includes a parameter with the same name as one of the parameters in the PowerShell command, PowerShell presents the parameter from your Bicep file with the postfix `FromTemplate`. For example, a parameter named `ResourceGroupName` in your Bicep file conflicts with the `ResourceGroupName` parameter in the [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment) cmdlet. You're prompted to provide a value for `ResourceGroupNameFromTemplate`. To avoid this confusion, use parameter names that aren't used for deployment commands.
480+
If your Bicep file includes a parameter with the same name as one of the parameters in the PowerShell command, PowerShell presents the parameter from your Bicep file with the `FromTemplate` postfix. For example, a parameter named `ResourceGroupName` in your Bicep file conflicts with the `ResourceGroupName` parameter in the [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment) cmdlet. You're prompted to provide a value for `ResourceGroupNameFromTemplate`. To avoid this confusion, use parameter names that aren't used for deployment commands.
481481

482482
## Next steps
483483

0 commit comments

Comments
 (0)