Skip to content

Commit 320ffaf

Browse files
authored
Merge pull request #204163 from tfitzmac/0708localfile
change parameter file syntax
2 parents bc0bacf + f08f49c commit 320ffaf

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use Azure Resource Manager and Azure CLI to deploy resources to Azu
44
author: mumian
55
ms.author: jgao
66
ms.topic: conceptual
7-
ms.date: 10/01/2021
7+
ms.date: 07/08/2022
88
ms.custom: devx-track-azurecli, seo-azure-cli
99
---
1010

@@ -110,7 +110,7 @@ az deployment group create \
110110

111111
If you're using Azure CLI with Windows Command Prompt (CMD) or PowerShell, pass the array in the format: `exampleArray="['value1','value2']"`.
112112

113-
You can also get the contents of file and provide that content as an inline parameter.
113+
You can also get the contents of file and provide that content as an inline parameter. Preface the file name with **@**.
114114

115115
```azurecli-interactive
116116
az deployment group create \
@@ -152,6 +152,15 @@ az deployment group create --name addstorage --resource-group myResourceGroup \
152152

153153
Use double quotes around the JSON that you want to pass into the object.
154154

155+
If you're using Azure CLI with Windows Command Prompt (CMD) or PowerShell, pass the object in the following format:
156+
157+
```azurecli
158+
$tags="{'Owner':'Contoso','Cost Center':'2345-324'}"
159+
az deployment group create --name addstorage --resource-group myResourceGroup \
160+
--template-file $bicepFile \
161+
--parameters resourceName=abcdef4556 resourceTags=$tags
162+
```
163+
155164
You can use a variable to contain the parameter values. In Bash, set the variable to all of the parameter values and add it to the deployment command.
156165

157166
```azurecli-interactive
@@ -171,14 +180,14 @@ Rather than passing parameters as inline values in your script, you may find it
171180

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

174-
To pass a local parameter file, use `@` to specify a local file named _storage.parameters.json_.
183+
To pass a local parameter file, specify the path and file name. The following example shows a parameter file named _storage.parameters.json_. The file is in the same directory where the command is run.
175184

176185
```azurecli-interactive
177186
az deployment group create \
178187
--name ExampleDeployment \
179188
--resource-group ExampleGroup \
180189
--template-file storage.bicep \
181-
--parameters @storage.parameters.json
190+
--parameters storage.parameters.json
182191
```
183192

184193
## Preview changes

0 commit comments

Comments
 (0)