英文:
Passing parameters using AZ CLI for ARM template deployment
问题
我正在尝试使用az group deployment create
执行ARM模板部署,并希望传递参数,其中的值在变量中定义。我可以使用以下语法轻松完成单个参数而无任何问题:
--parameters parameter1=$var1
但是,当我尝试使用以下语法添加其他参数时,它会失败:
--parameters parameter1=$var1, parameter2=$var2
以下语法也会失败,因为它不会使用变量的值:
--parameters '{
"parameter1": { "value": "$var1" },
"parameter2": { "value": "$var2" }
}'
有人知道我试图做的是否可能,以及正确的语法是什么吗?
英文:
I am trying to use az group deployment create
to perform an ARM template deployment and I want to pass in parameters where the values are defined in variables. I can do a single parameter with no issues using the syntax below:
--parameters parameter1=$var1
But when I try to add additional parameters using the syntax below, it fails:
--parameters parameter1=$var1, parameter2=$var2
The syntax below fails as well since it will not use the values of the variables:
--parameters '{
"parameter1": { "value": "$var1" },
"parameter2": { "value": "$var2" }
}'
Does anyone know if what I am trying to do is possible and what the correct syntax would be?
答案1
得分: 1
以下是要翻译的内容:
我正在应对一个受损的外壳和略微不正确的语法的组合。我尝试完成的正确语法如下:
--parameters parameter1=$var1 parameter2=$var2
或者,如果涉及多个参数时要更清晰:
--parameters parameter1=$var1 `
parameter2=$var2 `
parameter3=$var3
英文:
I was fighting a combination of a corrupt shell and slightly incorrect syntax. The correct syntax for what I was trying to do is listed below:
--parameters parameter1=$var1 parameter2=$var2
Or, for a cleaning view when several parameters are involved:
--parameters parameter1=$var1 `
parameter2=$var2 `
parameter3=$var3
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论