Skip to content

Commit e58a1f1

Browse files
authored
Merge pull request #184893 from eladperets/master
Update Microsoft.PolicyInsights docs
2 parents a5faef3 + 7337787 commit e58a1f1

File tree

3 files changed

+47
-11
lines changed

3 files changed

+47
-11
lines changed

articles/governance/policy/concepts/definition-structure.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,6 @@ The following properties are used with **field count**:
603603
**count.where** condition expression. A numeric
604604
[condition](../concepts/definition-structure.md#conditions) should be used.
605605

606-
**Field count** expressions can enumerate the same field array up to three times in a single
607-
**policyRule** definition.
608-
609606
For more details on how to work with array properties in Azure Policy, including detailed
610607
explanation on how the **field count** expression is evaluated, see
611608
[Referencing array resource properties](../how-to/author-policies-for-arrays.md#referencing-array-resource-properties).
@@ -647,11 +644,6 @@ The following properties are used with **value count**:
647644
`count.where` condition expression. A numeric
648645
[condition](../concepts/definition-structure.md#conditions) should be used.
649646

650-
The following limits are enforced:
651-
- Up to 10 **value count** expressions can be used in a single **policyRule** definition.
652-
- Each **value count** expression can perform up to 100 iterations. This number includes the number
653-
of iterations performed by any parent **value count** expressions.
654-
655647
#### The current function
656648

657649
The `current()` function is only available inside the `count.where` condition. It returns the value
@@ -1048,6 +1040,48 @@ resource name to start with the resource group name.
10481040
}
10491041
```
10501042

1043+
### Policy rule limits
1044+
1045+
#### Limits enforced during authoring
1046+
1047+
Limits to the structure of policy rules are enforced during the authoring or assignment of a policy.
1048+
Attempts to create or assign policy definitions that exceed these limits will fail.
1049+
1050+
| Limit | Value | Additional details |
1051+
|:---|:---|:---|
1052+
| Condition expressions in the **if** condition | 4096 | |
1053+
| Condition expressions in the **then** block | 128 | Applies to the **existenceCondition** of **AuditIfNotExists** and **DeployIfNotExists** policies |
1054+
| Policy functions per policy rule | 2048 | |
1055+
| Policy function number of parameters | 128 | Example: `[function('parameter1', 'parameter2', ...)]` |
1056+
| Nested policy functions depth | 64 | Example: `[function(nested1(nested2(...)))]` |
1057+
| Policy functions expression string length | 81920 | Example: the length of `"[function(....)]"` |
1058+
| **Field count** expressions per array | 5 | |
1059+
| **Value count** expressions per policy rule | 10 | |
1060+
| **Value count** expression iteration count | 100 | For nested **Value count** expressions, this also includes the iteration count of the parent expression |
1061+
1062+
#### Limits enforced during evaluation
1063+
1064+
Limits to the size of objects that are processed by policy functions during policy evaluation. These limits can't always be enforced during authoring since they depend on the evaluated content. For example:
1065+
1066+
```json
1067+
{
1068+
"field": "name",
1069+
"equals": "[concat(field('stringPropertyA'), field('stringPropertyB'))]"
1070+
}
1071+
```
1072+
1073+
The length of the string created by the `concat()` function depends of the value of properties in the evaluated resource.
1074+
1075+
| Limit | Value | Example |
1076+
|:---|:---|:---|
1077+
| Length of string returned by a function | 131072 | `[concat(field('longString1'), field('longString2'))]`|
1078+
| Depth of complex objects provided as a parameter to, or returned by a function | 128 | `[union(field('largeObject1'), field('largeObject2'))]` |
1079+
| Number of nodes of complex objects provided as a parameter to, or returned by a function | 32768 | `[concat(field('largeArray1'), field('largeArray2'))]` |
1080+
1081+
> [!WARNING]
1082+
> Policy that exceed the above limits during evaluation will effectively become a **deny** policy and can block incoming requests.
1083+
> When writing policies with complex functions, be mindful of these limits and test your policies against resources that have the potential to exceed them.
1084+
10511085
## Aliases
10521086

10531087
You use property aliases to access specific properties for a resource type. Aliases enable you to

articles/governance/policy/how-to/remediate-resources.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ To create a **remediation task**, follow these steps:
229229
1. On the **New remediation task** page, optional remediation settings are shown:
230230

231231
- **Failure Threshold percentage** - Used to specify whether the remediation task should fail if the percentage of failures exceeds the given threshold. Provided as a number between 0 to 100. By default, the failure threshold is 100%.
232-
- **Resource Count** - Determines how many non-compliant resources to remediate in a given remediation task. The default value is 500 (the previous limit). The maximum number of is 10,000 resources.
233-
- **Parallel Deployments** - Determines how many resources to remediate at the same time. The allowed values are 1 to 15 resources at a time. The default value is 10.
232+
- **Resource Count** - Determines how many non-compliant resources to remediate in a given remediation task. The default value is 500 (the previous limit). The maximum number of is 50,000 resources.
233+
- **Parallel Deployments** - Determines how many resources to remediate at the same time. The allowed values are 1 to 30 resources at a time. The default value is 10.
234234

235235
> [!NOTE]
236236
> These settings cannot be changed once the remediation task has started.

includes/azure-policy-limits.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ There's a maximum count for each object type for Azure Policy. For definitions,
2222
| Initiative definition | Parameters | 300 |
2323
| Policy or initiative assignments | Exclusions (notScopes) | 400 |
2424
| Policy rule | Nested conditionals | 512 |
25-
| Remediation task | Resources | 10,000 |
25+
| Remediation task | Resources | 50,000 |
26+
27+
Policy rules have additional limits to the number of conditions and their complexity. See [Policy rule limits](../articles/governance/policy/concepts/definition-structure.md#policy-rule-limits) for more details.

0 commit comments

Comments
 (0)