简体   繁体   English

带AND运算符的Azure ARM模板条件

[英]Azure ARM Template Condition with AND operator

Is it possible to use an AND operator in a condition? 是否可以在条件下使用AND运算符? For example, if first Parameter is "Apple" and second Parameter B is "Banana" then deploy a resource? 例如,如果第一个参数是“ Apple”,第二个参数B是“ Banana”,那么部署资源吗? My example below is only for if Parameter A is "Yes" 我下面的示例仅适用于参数A为“是”的情况

  "condition": "[equals(parameters('firstParameter'), 'Apple')]",
  "apiVersion": "2017-05-10",
  "name": "deployRandomResource",
  "type": "Microsoft.Resources/deployments",

yeah, just nest those one inside the other: 是的,只需将其中一个嵌套在另一个中即可:

"[and(equals(fooooo), equals(baaaaar))]"

you can also nest more expressions: 您还可以嵌套更多表达式:

"[not(or(equals(something, something), and(something, something)))]"
  ^   ^ if any of the arguments are true - or returns true
  ^ this read like invert the result: true becomes false and false becomes true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM