Skip to content

Commit b1e9b39

Browse files
Merge pull request #269472 from mumian/0319-bicepparam-using
Add more using statement examples
2 parents df7775b + 36f9380 commit b1e9b39

File tree

1 file changed

+34
-5
lines changed

1 file changed

+34
-5
lines changed

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

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Create parameters files for Bicep deployment
3-
description: Create parameters file for passing in values during deployment of a Bicep file
3+
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: 01/17/2024
6+
ms.date: 03/19/2024
77
---
88

99
# Create parameters files for Bicep deployment
@@ -15,7 +15,7 @@ Rather than passing parameters as inline values in your script, you can use a Bi
1515
1616
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.
1717

18-
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).
18+
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

2020
## Parameters file
2121

@@ -30,6 +30,35 @@ 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:
34+
35+
```bicep
36+
using './main.bicep'
37+
...
38+
```
39+
40+
```bicep
41+
using './azuredeploy.json'
42+
...
43+
```
44+
45+
```bicep
46+
using 'br/public:storage/storage-account:3.0.1'
47+
...
48+
```
49+
50+
```bicep
51+
using 'br:myacr.azurecr.io/bicep/modules/storage:v1'
52+
...
53+
```
54+
55+
```bicep
56+
using 'ts:00000000-0000-0000-0000-000000000000/myResourceGroup/storageSpec:1.0'
57+
...
58+
```
59+
60+
For more information, see the [using statement](./bicep-using.md).
61+
3362
You can use expressions with the default value. For example:
3463

3564
```bicep
@@ -328,15 +357,15 @@ To generate a parameters file, you have two options: either through Visual Studi
328357

329358
## Build Bicep parameters file
330359

331-
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).
332361

333362
## Deploy Bicep file with parameters file
334363

335364
From Azure CLI, you can pass a parameter file with your Bicep file deployment.
336365

337366
# [Bicep parameters file](#tab/Bicep)
338367

339-
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 is no need to provide the `--template-file` switch when specifying a Bicep parameter file for the `--parameters` switch. Including the `--template-file` switch will result in an "Only a .bicep template is allowed with a .bicepparam file" error.
368+
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. Including the `--template-file` switch results in an "Only a .bicep template is allowed with a .bicepparam file" error.
340369

341370
```azurecli
342371
az deployment group create \

0 commit comments

Comments
 (0)