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
2. Assign the required role to the identity created for the policy assignment.
@@ -156,7 +156,7 @@ To create a remediation task for policies during the policy assignment, select t
156
156
157
157
To create a remediation task after the policy has been assigned, select your assigned policy from the list on the Policy Assignments page.
158
158
159
-
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/remediation-after-assignment.png" alt-text="A screenshot showing the edit-initiative-assignment page with the checkbox unselected.":::
159
+
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/remediation-after-assignment.png" alt-text="A screenshot showing the policy remediation page.":::
160
160
161
161
Select **Remediate**.
162
162
Track the status of your remediation task in the **Remediation tasks** tab of the Policy Remediation page.
@@ -269,12 +269,11 @@ You can get your policy assignment details using the following command:
269
269
270
270
### [CLI](#tab/cli)
271
271
272
-
Assign intitiatevs and remediatie policies using Azure CLI.
273
272
274
-
1.Log in to your Azure account using the `az login` command.
273
+
1.Sign in to your Azure account using the `az login` command.
275
274
1. Select the subscription where you want to apply the policy initiative using the `az account` set command.
276
275
277
-
1. Assign the initiative.
276
+
1. Assign the initiative using [az policy assignment create](https://learn.microsoft.com/cli/azure/policy/assignment?view=azure-cli-latest#az-policy-assignment-create).
278
277
279
278
```azurecli
280
279
az policy assignment create --name <assignment name> --resource-group <resource group name> --policy-set-definition <initiative name> --params <parameters object> --mi-system-assigned --location <location>
@@ -296,7 +295,7 @@ Assign intitiatevs and remediatie policies using Azure CLI.
296
295
"deployment": {
297
296
"properties": {...
298
297
```
299
-
Assign the required role:
298
+
Assign the required role using [az policy assignment identity assign](https://learn.microsoft.com/cli/azure/policy/assignment/identity?view=azure-cli-latest):
300
299
```azurecli
301
300
az policy assignment identity assign --system-assigned --resource-group <resource group name> --role <role name or ID> --identity-scope <scope> --name <policy assignment name>
302
301
```
@@ -305,23 +304,22 @@ Assign intitiatevs and remediatie policies using Azure CLI.
1. Create remediation tasks for the policies in the initiative.
307
+
1. Create remediation tasks for the policies in the initiative.
309
308
310
-
Remediation tasks are done on a per-policy basis. Each task is for a specific `definition-reference-id`, specified in the initiative as `policyDefinitionReferenceId`
311
-
To find the `definition-reference-id` parameter use the follwoing command:
309
+
Remediation tasks are created per-policy. Each task is for a specific `definition-reference-id`, specified in the initiative as `policyDefinitionReferenceId`. To find the `definition-reference-id` parameter, use the following command:
312
310
```azurecli
313
311
az policy set-definition show --name f5b29bc4-feca-4cc6-a58a-772dd5e290a5 |grep policyDefinitionReferenceId
314
312
```
315
-
Remediate the resources
313
+
Remediate the resources using [az policy remediation create](https://learn.microsoft.com/cli/azure/policy/remediation?view=azure-cli-latest#az-policy-remediati
314
+
316
315
```azurecli
317
316
az policy remediation create --resource-group <resource group name> --policy-assignment <assignment name> --name <remediation task name> --definition-reference-id "policy specific reference ID" --resource-discovery-mode ReEvaluateCompliance
To create a remediation task for all of the policies in the initiative,
324
-
322
+
To create a remediation task for all of the policies in the initiative, use the following example:
325
323
```bash
326
324
for policyDefinitionReferenceId in $(az policy set-definition show --name f5b29bc4-feca-4cc6-a58a-772dd5e290a5 |grep policyDefinitionReferenceId |cut -d":" -f2|sed s/\"//g)
0 commit comments