Skip to content

Commit 1bac61b

Browse files
authored
Merge pull request #302044 from mumian/0626-using-none
Document using none
2 parents b32055d + 1a2b88c commit 1bac61b

File tree

3 files changed

+58
-15
lines changed

3 files changed

+58
-15
lines changed

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

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
---
2-
title: Using statement
3-
description: Learn how to use the `using` statement in Bicep.
2+
title: Using and using none statements
3+
description: Learn how to use the `using` and `using none` statements in Bicep.
44
ms.topic: conceptual
5-
ms.date: 01/10/2025
5+
ms.date: 06/30/2025
66
ms.custom: devx-track-bicep
77
---
88

9-
# Using statement
9+
# Using and using none statements
1010

11-
The `using` statement in [Bicep parameters files](./parameter-files.md) ties the file to a [Bicep file](./file.md), a [JSON Azure Resource Manager template (ARM template)](../templates/syntax.md), a [Bicep module](./modules.md), or a [template spec](./template-specs.md). A `using` declaration must be present in all Bicep parameters files.
11+
A `using` or a `using none` declaration must be present in all Bicep parameters files.
12+
13+
A Bicep parameter file typically uses a `using` statement to tie the file to a [Bicep file](./file.md), a [JSON Azure Resource Manager template (ARM template)](../templates/syntax.md), a [Bicep module](./modules.md), or a [template spec](./template-specs.md). This linkage allows the Bicep language server and compiler to validate the parameter file—checking for correct names, types, and required values based on the template’s inputs.
14+
15+
In contrast, the `using none` statement explicitly indicates that the parameter file isn't tied to any particular template at compile time. This means the parameters aren't validated against a specific template and are instead intended for more general use—such as being consumed by external tools or serving as shared, reusable parameter sets.
1216

1317
> [!NOTE]
14-
> The Bicep parameters file is only supported in the [Bicep CLI](./install.md#visual-studio-code-and-bicep-extension) version 0.18.4 or later, [Azure CLI](/cli/azure/install-azure-cli) version 2.47.0 or later, and [Azure PowerShell](/powershell/azure/install-azure-powershell) version 9.7.1 or later.
18+
> Bicep parameters files are supported only in [Bicep CLI version 0.18.4](https://github.com/Azure/bicep/releases/tag/v0.18.4) or later, [Azure CLI](/cli/azure/install-azure-cli) version 2.47.0 or later, and [Azure PowerShell](/powershell/azure/install-azure-powershell) version 9.7.1 or later. The `using none` feature is supported in [Bicep CLI version 0.31.0](https://github.com/Azure/bicep/releases/tag/v0.31.92) or later.
1519
>
16-
> To use the statement with JSON ARM templates, Bicep modules, and template specs, you need to have [Bicep CLI](./install.md#visual-studio-code-and-bicep-extension) version 0.22.6 or later and [Azure CLI](/cli/azure/install-azure-cli) version 2.53.0 or later.
20+
> To use the statement with JSON ARM templates, Bicep modules, and template specs, you need to have [Bicep CLI version 0.22.6](https://github.com/Azure/bicep/releases/tag/v0.22.6) or later and [Azure CLI](/cli/azure/install-azure-cli) version 2.53.0 or later.
1721
18-
## Syntax
22+
## The using statement
23+
24+
The syntax of the `using` statement:
1925

2026
- To use Bicep files:
2127

@@ -91,6 +97,40 @@ The `using` statement in [Bicep parameters files](./parameter-files.md) ties the
9197
using 'ts/myStorage:storageSpec:1.0'
9298
```
9399

100+
## The using none statement
101+
102+
The `using none` statement in a Bicep parameters file (.bicepparam) indicates that the file isn't tied to a specific Bicep template during authoring or compilation. This decouples the parameter file from a particular template, enabling greater flexibility in how parameters are defined and used across deployments.
103+
104+
The syntax of the `using none` statement:
105+
106+
```bicep
107+
using none
108+
```
109+
110+
This statement is placed at the beginning of a Bicep parameters file to signal that no specific template is referenced.
111+
112+
The primary benefit of `using none` in Bicep lies in scenarios where parameter files are generalized, shared, or dynamically integrated with templates. Common use cases include:
113+
114+
- **Centralized Parameter Repositories**
115+
116+
Organizations often maintain standard parameter values—such as default regions, naming conventions, or global tags—used across multiple Bicep deployments. A Bicep parameters file with using none can act as a central store for these shared values, improving consistency and minimizing duplication. These parameters can then be programmatically merged with template-specific values at deployment time.
117+
118+
For example, a shared Bicep parameters file might define:
119+
120+
```bicepparam
121+
using none
122+
123+
param location = 'westus2'
124+
param environmentTag = 'production'
125+
param projectName = 'myApp'
126+
```
127+
128+
- **Dynamic Generation and Runtime Integration**
129+
130+
In CI/CD pipelines or automation scripts, parameter files may be created on-the-fly or associated with templates at runtime. By omitting a fixed template reference, `using none` allows these files to remain flexible and adaptable to different deployment contexts.
131+
132+
When `using none` is specified in a Bicep parameter file, the compiler doesn't validate the parameters against a specific Bicep template, meaning no compile-time warnings or errors are raised for mismatched names or types due to the absence of a linked template. However, this decoupling applies only during authoring and compilation—at deployment time, Azure Resource Manager (ARM) still requires both a Bicep template and a parameter file. The ARM engine performs validation during deployment by resolving the parameters in the file against those defined in the target template.
133+
94134
## Next steps
95135

96136
- Learn about Bicep parameters files in [Create parameters files for Bicep deployment](./parameter-files.md).

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create a parameters file for bicep deployment
33
description: Learn how to create Bicep parameters files instead of passing parameters as inline values in your script.
44
ms.topic: how-to
55
ms.custom: devx-track-bicep
6-
ms.date: 03/25/2025
6+
ms.date: 06/30/2025
77
---
88

99
# Create a parameters file for Bicep deployment
@@ -15,9 +15,9 @@ These parameter files also help enable a streamlined CI/CD deployment approach.
1515
This article shows you how to create a parameters file, which you can use instead of passing parameters as inline values in your script. You can use either a Bicep parameters file with the `.bicepparam` file extension or a JSON parameters file that contains the parameter value.
1616

1717
> [!NOTE]
18-
> Bicep parameters files are supported only in [Bicep CLI](./install.md#visual-studio-code-and-bicep-extension) version 0.18.4 or later, [Azure CLI](/cli/azure/install-azure-cli) version 2.47.0 or later, and [Azure PowerShell](/powershell/azure/install-azure-powershell) version 9.7.1 or later.
18+
> Bicep parameters files are supported only in [Bicep CLI version 0.18.4](https://github.com/Azure/bicep/releases/tag/v0.18.4) or later, [Azure CLI](/cli/azure/install-azure-cli) version 2.47.0 or later, and [Azure PowerShell](/powershell/azure/install-azure-powershell) version 9.7.1 or later. The `using none` feature is supported in [Bicep CLI version 0.31.0](https://github.com/Azure/bicep/releases/tag/v0.31.92) or later.
1919
20-
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. You can establish this relationship by applying the [`using` statement](./bicep-using.md) within the Bicep parameters file.
20+
A single Bicep file can be associated with multiple parameter files. However, each parameter file is typically linked to one specific Bicep file—unless `using none` is specified. This association is established using the [`using` statement](./bicep-using.md) within the parameter file.
2121

2222
You can compile Bicep parameters files into JSON parameters files that you can deploy by using a Bicep file. For more information, see [`build-params`](./bicep-cli.md#build-params). You can also decompile a JSON parameters file into a Bicep parameters file. For more information, see [`decompile-params`](./bicep-cli.md#decompile-params).
2323

@@ -28,7 +28,7 @@ A parameters file uses the following format:
2828
### [Bicep parameters file](#tab/Bicep)
2929

3030
```bicep
31-
using '<path>/<file-name>.bicep'
31+
using '<path>/<file-name>.bicep' | using none
3232
3333
param <first-parameter-name> = <first-value>
3434
param <second-parameter-name> = <second-value>
@@ -61,8 +61,11 @@ using 'ts:00000000-0000-0000-0000-000000000000/myResourceGroup/storageSpec:1.0'
6161
...
6262
```
6363

64-
For more information, see [Using statement](./bicep-using.md).
64+
For more information, see [Using statement](./bicep-using.md#the-using-statement).
6565

66+
You can apply the `using none` statement to indicate that the parameters file is not tied to a specific Bicep template during authoring or compilation. This decouples the parameter file from a particular template, enabling greater flexibility in how parameters are defined and used across deployments. For more information, see [Using none statement](./bicep-using.md#the-using-none-statement).
67+
68+
```bicep
6669
You can use expressions with the default value. For example:
6770
6871
```bicep

articles/azure-resource-manager/bicep/toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ items:
272272
- name: Modules (module)
273273
displayName: scopes,consume,registry,module registry,private module registry,public module registry,avm,azure verified modules
274274
href: modules.md
275-
- name: Using (using)
276-
displayName: avm,azure verified modules
275+
- name: Using (using/using none)
276+
displayName: avm,azure verified modules,using none
277277
href: bicep-using.md
278278
- name: Import (import)
279279
href: bicep-import.md

0 commit comments

Comments
 (0)