Skip to content

Commit b55fb44

Browse files
Merge pull request #269951 from mumian/0321-bicep-parameters
Add information about using parameters file and inline parameters
2 parents b5b3420 + 88b1d8a commit b55fb44

File tree

4 files changed

+69
-8
lines changed

4 files changed

+69
-8
lines changed

articles/azure-resource-manager/bicep/deploy-cli.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Deploy resources with Azure CLI and Bicep files | Microsoft Docs
33
description: Use Azure Resource Manager and Azure CLI to deploy resources to Azure. The resources are defined in a Bicep file.
44
ms.topic: conceptual
5-
ms.date: 11/03/2023
5+
ms.date: 03/22/2024
66
ms.custom: devx-track-azurecli, seo-azure-cli, devx-track-arm-template, devx-track-bicep
77
---
88

@@ -203,6 +203,8 @@ az deployment group create \
203203

204204
For more information about the parameters file, see [Create Resource Manager parameters file](./parameter-files.md).
205205

206+
You can use inline parameters and a location parameters file in the same deployment operation. For more information, see [Parameter precedence](./parameter-files.md#parameter-precedence).
207+
206208
## Preview changes
207209

208210
Before deploying your Bicep file, you can preview the changes the Bicep file will make to your environment. Use the [what-if operation](./deploy-what-if.md) to verify that the Bicep file makes the changes that you expect. What-if also validates the Bicep file for errors.

articles/azure-resource-manager/bicep/deploy-powershell.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Deploy resources with PowerShell and Bicep
33
description: Use Azure Resource Manager and Azure PowerShell to deploy resources to Azure. The resources are defined in a Bicep file.
44
ms.topic: conceptual
55
ms.custom: devx-track-arm-template, devx-track-bicep, devx-track-azurepowershell
6-
ms.date: 11/03/2023
6+
ms.date: 03/22/2024
77
---
88

99
# Deploy resources with Bicep and Azure PowerShell
@@ -167,6 +167,8 @@ New-AzResourceGroupDeployment `
167167

168168
The `TemplateParameterUri` parameter doesn't support `.bicepparam` files, it only supports JSON parameters files.
169169

170+
You can use inline parameters and a location parameters file in the same deployment operation. For more information, see [Parameter precedence](./parameter-files.md#parameter-precedence).
171+
170172
## Preview changes
171173

172174
Before deploying your Bicep file, you can preview the changes the Bicep file will make to your environment. Use the [what-if operation](./deploy-what-if.md) to verify that the Bicep file makes the changes that you expect. What-if also validates the Bicep file for errors.

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

Lines changed: 61 additions & 4 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: conceptual
55
ms.custom: devx-track-bicep
6-
ms.date: 03/19/2024
6+
ms.date: 03/22/2024
77
---
88

99
# Create parameters files for Bicep deployment
@@ -361,6 +361,8 @@ From Bicep CLI, you can build a Bicep parameters file into a JSON parameters fil
361361

362362
## Deploy Bicep file with parameters file
363363

364+
### Azure CLI
365+
364366
From Azure CLI, you can pass a parameter file with your Bicep file deployment.
365367

366368
# [Bicep parameters file](#tab/Bicep)
@@ -386,8 +388,35 @@ az deployment group create \
386388

387389
---
388390

391+
You can use inline parameters and a location parameters file in the same deployment operation. For example:
392+
393+
# [Bicep parameters file](#tab/Bicep)
394+
395+
```azurecli
396+
az deployment group create \
397+
--name ExampleDeployment \
398+
--resource-group ExampleGroup \
399+
--parameters storage.bicepparam \
400+
--parameters storageAccountType=Standard_LRS
401+
```
402+
403+
# [JSON parameters file](#tab/JSON)
404+
405+
```azurecli
406+
az deployment group create \
407+
--name ExampleDeployment \
408+
--resource-group ExampleGroup \
409+
--template-file storage.bicep \
410+
--parameters storage.parameters.json \
411+
--parameters storageAccountType=Standard_LRS
412+
```
413+
414+
---
415+
389416
For more information, see [Deploy resources with Bicep and Azure CLI](./deploy-cli.md#parameters).
390417

418+
### Azure PowerShell
419+
391420
From Azure PowerShell, pass a local parameters file using the `TemplateParameterFile` parameter.
392421

393422
# [Bicep parameters file](#tab/Bicep)
@@ -402,7 +431,6 @@ New-AzResourceGroupDeployment `
402431

403432
# [JSON parameters file](#tab/JSON)
404433

405-
406434
```azurepowershell
407435
New-AzResourceGroupDeployment `
408436
-Name ExampleDeployment `
@@ -411,15 +439,44 @@ New-AzResourceGroupDeployment `
411439
-TemplateParameterFile C:\MyTemplates\storage.parameters.json
412440
```
413441

442+
---
443+
444+
You can use inline parameters and a location parameters file in the same deployment operation. For example:
445+
446+
# [Bicep parameters file](#tab/Bicep)
447+
448+
```azurepowershell
449+
New-AzResourceGroupDeployment `
450+
-Name ExampleDeployment `
451+
-ResourceGroupName ExampleResourceGroup `
452+
-TemplateFile C:\MyTemplates\storage.bicep `
453+
-TemplateParameterFile C:\MyTemplates\storage.bicepparam `
454+
-storageAccountType Standard_LRS
455+
```
456+
457+
# [JSON parameters file](#tab/JSON)
458+
459+
```azurepowershell
460+
New-AzResourceGroupDeployment `
461+
-Name ExampleDeployment `
462+
-ResourceGroupName ExampleResourceGroup `
463+
-TemplateFile C:\MyTemplates\storage.bicep `
464+
-TemplateParameterFile C:\MyTemplates\storage.parameters.json `
465+
-storageAccountType Standard_LRS
466+
467+
```
468+
469+
470+
414471
---
415472

416473
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.
417474

418475
## Parameter precedence
419476

420-
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.
477+
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.
421478

422-
It's possible to use an external parameters file, by providing the URI to the file. 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.
479+
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.
423480

424481
## Parameter name conflicts
425482

articles/azure-resource-manager/bicep/parameters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Parameters in Bicep files
33
description: Describes how to define parameters in a Bicep file.
44
ms.topic: conceptual
55
ms.custom: devx-track-bicep
6-
ms.date: 12/06/2023
6+
ms.date: 03/22/2024
77
---
88

99
# Parameters in Bicep
@@ -235,8 +235,8 @@ The following example shows a parameter that is an object. The default value sho
235235

236236
:::code language="bicep" source="~/azure-docs-bicep-samples/syntax-samples/parameters/parameterobject.bicep":::
237237

238-
239238
## Next steps
240239

241240
- To learn about the available properties for parameters, see [Understand the structure and syntax of Bicep files](file.md).
242241
- To learn about passing in parameter values as a file, see [Create a Bicep parameter file](parameter-files.md).
242+
- To learn about providing parameter values at deployment, see [Deploy with Azure CLI](./deploy-cli.md), and [Deploy with Azure PowerShell](./deploy-powershell.md).

0 commit comments

Comments
 (0)