File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
articles/governance/policy/samples Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
title : " Pattern: Logical operators in a policy definition"
3
3
description : This Azure Policy pattern provides examples of how to use the logical operators in a policy definition.
4
- ms.date : 01/31 /2020
4
+ ms.date : 04/15 /2020
5
5
ms.topic : sample
6
6
---
7
7
# Azure Policy pattern: logical operators
@@ -42,6 +42,22 @@ the **not** logical operator. The conditional inside the **not** logical operato
42
42
and then evaluates the ** not** to determine if the entire clause is true or false. If both ** not**
43
43
logical operators evaluate to true, the policy effect triggers.
44
44
45
+ ## Sample 3: Combining logical operators
46
+
47
+ This policy definition evaluates Java Spring accounts to see if either trace isn't enabled or if
48
+ trace isn't in a successful state.
49
+
50
+ :::code language="json" source="~ /policy-templates/patterns/pattern-logical-operators-3.json":::
51
+
52
+ ### Sample 3: Explanation
53
+
54
+ :::code language="json" source="~ /policy-templates/patterns/pattern-logical-operators-3.json" range="6-28" highlight="3,8":::
55
+
56
+ This ** policyRule.if** block includes both the ** allOf** and ** anyOf** logical operators. The
57
+ ** anyOf** logical operator evaluates true as long as one included condition is true. As the _ type_
58
+ is at the core of the ** allOf** , it must always evaluate true. If the _ type_ and one of the
59
+ conditions in the ** anyOf** are true, the policy effect triggers.
60
+
45
61
## Next steps
46
62
47
63
- Review other [ patterns and built-in definitions] ( ./index.md ) .
You can’t perform that action at this time.
0 commit comments