You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Details of the policy remediation task structure
3
3
description: Describes the policy remediation task definition used by Azure Policy to bring resources into compliance.
4
-
ms.date: 11/03/2022
4
+
ms.date: 08/30/2024
5
5
ms.topic: conceptual
6
6
ms.author: kenieva
7
7
author: kenieva
8
8
---
9
+
9
10
# Azure Policy remediation task structure
10
11
11
-
The Azure Policy remediation task feature is used to bring resources into compliance established from a definition and assignment. Resources that are non-compliant to a [modify](./effects.md#modify) or [deployIfNotExist](./effects.md#deployifnotexists) definition assignment, can be brought into compliance using a remediation task. Remediation task deploys the deployIFNotExist template or the modify operations to the selected non-compliant resources using the identity specified in the assignment. See [policy assignment structure](./assignment-structure.md#identity). to understand how the identity is define and [remediate non-compliant resources tutorial](../how-to/remediate-resources.md#configure-the-managed-identity) to configure the identity.
12
+
The Azure Policy remediation task feature is used to bring resources into compliance established from a definition and assignment. Resources that are non-compliant to a [modify](./effect-modify.md) or [deployIfNotExists](./effect-deploy-if-not-exists.md) definition assignment, can be brought into compliance using a remediation task. A remediation task deploys the `deployIfNotExists` template or the `modify` operations to the selected non-compliant resources using the identity specified in the assignment. For more information, see [policy assignment structure](./assignment-structure.md#identity) to understand how the identity is defined and [remediate non-compliant resources tutorial](../how-to/remediate-resources.md#configure-the-managed-identity) to configure the identity.
13
+
14
+
Remediation tasks remediate existing resources that aren't compliant. Resources that are newly created or updated that are applicable to a `deployIfNotExists` or `modify` definition assignment are automatically remediated.
12
15
13
16
> [!NOTE]
14
-
> Remediation tasks remediate exisiting resources that are not compliant. Resources that are newly created or updated that are applicable to a deployIfNotExist or modify definition assignment are automatically remediated.
17
+
> The Azure Policy service deletes remediation task resources 60 days after their last modification.
15
18
16
19
You use JavaScript Object Notation (JSON) to create a policy remediation task. The policy remediation task contains elements for:
17
20
@@ -26,93 +29,82 @@ You use JavaScript Object Notation (JSON) to create a policy remediation task. T
26
29
-[provisioning state and deployment summary](#provisioning-state-and-deployment-summary)
27
30
28
31
29
-
For example, the following JSON shows a policy remediation task for policy definition named `requiredTags` a part of
30
-
an initiative assignment named `resourceShouldBeCompliantInit` with all default settings.
32
+
For example, the following JSON shows a policy remediation task for policy definition named `requiredTags` a part of an initiative assignment named `resourceShouldBeCompliantInit` with all default settings.
Steps on how to trigger a remediation task at [how to remediate non-compliant resources guide](../how-to/remediate-resources.md)
50
-
51
-
> [!NOTE]
52
-
> These settings cannot be changed once the remediation task has started.
53
51
52
+
Steps on how to trigger a remediation task at [how to remediate non-compliant resources guide](../how-to/remediate-resources.md). These settings can't be changed after the remediation task begins.
54
53
55
54
## Display name and description
56
55
57
-
You use **displayName** and **description** to identify the policy remediation task and provide context for
58
-
its use. **displayName** has a maximum length of _128_ characters and
59
-
**description** a maximum length of _512_ characters.
56
+
You use `displayName` and `description` to identify the policy remediation task and provide context for its use. `displayName` has a maximum length of _128_ characters and `description` a maximum length of _512_ characters.
60
57
61
58
## Policy assignment ID
62
59
63
-
This field must be the full path name of either a policy assignment or an initiative assignment.
64
-
`policyAssignmentId` is a string and not an array. This property defines which assignment the parent
65
-
resource hierarchy or individual resource to remediate.
60
+
This field must be the full path name of either a policy assignment or an initiative assignment. `policyAssignmentId` is a string and not an array. This property defines which assignment the parent resource hierarchy or individual resource to remediate.
66
61
67
62
## Policy definition ID
68
63
69
-
If the `policyAssignmentId` is for an initiative assignment, the **policyDefinitionReferenceId** property must be used to specify which policy definition in the initiative the subject resource(s) are to be remediated. As a remediation can only remediate in a scope of one definition,
70
-
this property is a _string_ and not an array. The value must match the value in the initiative definition in the
71
-
`policyDefinitions.policyDefinitionReferenceId` field instead of the global identifier for policy definition `Id`.
64
+
If the `policyAssignmentId` is for an initiative assignment, the `policyDefinitionReferenceId` property must be used to specify which policy definition in the initiative the subject resources are to be remediated. As a remediation can only remediate in a scope of one definition, this property is a _string_ and not an array. The value must match the value in the initiative definition in the `policyDefinitions.policyDefinitionReferenceId` field instead of the global identifier for policy definition `Id`.
72
65
73
66
## Resource count and parallel deployments
74
67
75
-
Use **resource count**to determine how many non-compliant resources to remediate in a given remediation task. The default value is 500, with the maximum number being 50,000. **Parallel deployments**determines how many of those resources to remediate at the same time. The allowed range is between 1 to 30 with the default value being 10.
68
+
Use `resourceCount`to determine how many non-compliant resources to remediate in a given remediation task. The default value is 500, with the maximum number being 50,000. `parallelDeployments`determines how many of those resources to remediate at the same time. The allowed range is between 1 to 30 with the default value being 10.
76
69
77
-
> [!NOTE]
78
-
> Parallel deployments are the number of deployments within a singular remediation task with a maximum of 30. There can be a maximum of 100 remediation tasks running in parallel for a single policy definition or policy reference within an initiative.
70
+
Parallel deployments are the number of deployments within a singular remediation task with a maximum of 30. There can be a maximum of 100 remediation tasks running in parallel for a single policy definition or policy reference within an initiative.
79
71
80
72
## Failure threshold
81
73
82
-
An optional property used to specify whether the remediation task should fail if the percentage of failures exceeds the given threshold. The **failure threshold**is represented as a percentage number from 0 to 100. By default, the failure threshold is 100%, meaning that the remediation task will continue to remediate other resources even if resources fail to remediate.
74
+
An optional property used to specify whether the remediation task should fail if the percentage of failures exceeds the given threshold. The `failureThreshold`is represented as a percentage number from 0 to 100. By default, the failure threshold is 100%, meaning that the remediation task continues to remediate other resources even if resources fail to remediate.
83
75
84
-
## Remediation filters
76
+
## Remediation filters
85
77
86
-
An optional property refines what resources are applicable to the remediation task. The allowed filter is resource location. Unless specified, resources from any region can be remediated.
78
+
An optional property refines what resources are applicable to the remediation task. The allowed filter is resource location. Unless specified, resources from any region can be remediated.
87
79
88
80
## Resource discovery mode
89
81
90
-
This property decides how to discover resources that are eligible for remediation. For a resource to be eligible, it must be non-compliant. By default, this property is set to `ExistingNonCompliant`. It could also be set to `ReEvaluateCompliance`, which will trigger a new compliance scan for that assignment and remediate any resources that are found non-compliant.
82
+
This property decides how to discover resources that are eligible for remediation. For a resource to be eligible, it must be non-compliant. By default, this property is set to `ExistingNonCompliant`. It could also be set to `ReEvaluateCompliance`, which triggers a new compliance scan for that assignment and remediate any resources that are found non-compliant.
91
83
92
84
## Provisioning state and deployment summary
93
85
94
-
Once a remediation task is created, **provisioning state**and **deployment summary**properties are populated. **Provisioning state** indicates the status of the remediation task. Allow values are `Running`, `Canceled`, `Cancelling`, `Failed`, `Complete`, or `Succeeded`. **Deployment summary** is an array property indicating the number of deployments along with number of successful and failed deployments.
86
+
Once a remediation task is created, `ProvisioningState`and `DeploymentSummary`properties are populated. The `ProvisioningState` indicates the status of the remediation task. Allow values are `Running`, `Canceled`, `Cancelling`, `Failed`, `Complete`, or `Succeeded`. The `DeploymentSummary` is an array property indicating the number of deployments along with number of successful and failed deployments.
95
87
96
-
Sample of remediation task that completed successfully:
88
+
Sample of remediation task that completed successfully:
0 commit comments