我如何使用 Azure AZ override/add 参数

How do I override/add parameters using Azure AZ

以前使用 AzureRM 时我的脚本看起来像这样

New-AzureRmResourceGroupDeployment `
-Name LocalTestDeployment `
-ResourceGroupName xxx-${env}-${location} `
-Mode Incremental `
-TemplateFile ..\webapp\azuredeploy.json `
-TemplateParameterFile ..\webapp\azuredeploy.parameters-dev.json `
-azureEnvironment ${env} `
-locationKey ${location}

我如何在 Azure AZ 中执行相同的操作?

这是我从文档中找到的内容的进展,但是我如何处理最后两行 override/add 模板的额外属性?

az group deployment create `
--name LocalTestDeployment `
--resource-group xxx-${env}-${location} `
--mode Incremental `
--template-file ..\webapp\azuredeploy.json `
--parameters `@..\webapp\azuredeploy.parameters-dev.json `
-azureEnvironment ${env} `
-locationKey ${location}

我仔细查看了文档,发现了这个例子:

az group deployment create -g MyResourceGroup --template-file azuredeploy.json \
                        --parameters @params.json --parameters https://mysite/params.json --parameters MyValue=This MyArray=@array.json

看起来我错过了之前那个例子的最后一部分,当我尝试它按预期工作时。

工作示例:

az group deployment create `
--name LocalTestDeployment `
--resource-group xxx-${env}-${location} `
--mode Incremental `
--template-file ..\webapp\azuredeploy.json `
--parameters `@..\webapp\azuredeploy.parameters-dev.json `
--parameters azureEnvironment=${env} locationKey=${location}