如何在 Azure ARM 模板中使用 and operator in conditions
How to use and operator in conditions in Azure ARM template
"condition": "[equals(parameters('CreateNewNIC'), 'yes')]",
"condition": "[greaterOrEquals(parameters('VM_Instances'), 1 )]",
我有两个条件如上图。但我希望它介于 AND 条件之间。这意味着两者都应该得到满足,然后只执行下面的脚本。
我想要类似 (Condition1 AND condition2)
then
执行脚本的其余部分 else
不要执行。
您可以尝试运算符 and:
"condition": "[and(equals(parameters('CreateNewNIC'), 'yes'), greaterOrEquals(parameters('VM_Instances'), 1 ))]"
"condition": "[equals(parameters('CreateNewNIC'), 'yes')]",
"condition": "[greaterOrEquals(parameters('VM_Instances'), 1 )]",
我有两个条件如上图。但我希望它介于 AND 条件之间。这意味着两者都应该得到满足,然后只执行下面的脚本。
我想要类似 (Condition1 AND condition2)
then
执行脚本的其余部分 else
不要执行。
您可以尝试运算符 and:
"condition": "[and(equals(parameters('CreateNewNIC'), 'yes'), greaterOrEquals(parameters('VM_Instances'), 1 ))]"