以前我的脚本使用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中执行相同的操作?
这是我在文档中找到的内容,但是如何处理我覆盖/添加额外属性到模板的最后两行?
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 [email protected]
看起来我早先错过了那个例子的最后一部分,当我尝试它按预期工作时。
工作范例:
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}