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
Copy file name to clipboardExpand all lines: articles/azure-monitor/essentials/diagnostics-settings-policies-deployifnotexists.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ Find the role in the policy definition by searching for *roleDefinitionIds*
92
92
93
93
For example,
94
94
```azurecli
95
-
az policy remediation create -g rg-001 -n remediation-001 --policy-assignment policy-assignment-1
95
+
az policy remediation create -g rg-001 -n remediation-001 --policy-assignment policy-assignment-1
96
96
```
97
97
98
98
For more information on policy assignment using CLI, see [Azure CLI reference - az policy assignment](/cli/azure/policy/assignment#az-policy-assignment-create)
@@ -133,15 +133,15 @@ To apply a policy using the PowerShell, use the following commands:
133
133
}
134
134
```
135
135
136
-
1. Scan for compliance, then create a remediation task to force compliance for existing resources.
136
+
1. Scan for compliance, then create a remediation task to force compliance for existing resources.
Track the status of your remediation task in the **Remediation tasks** tab of the Policy Remediation page.
166
166
167
-
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/new-remediation-task-after-assignment.png" alt-text="A screenshot showing the new remediation task page.":::
167
+
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/new-remediation-task-after-assignment.png" lightbox="./media/diagnostics-settings-policies-deployifnotexists/new-remediation-task-after-assignment.png" alt-text="A screenshot showing the new remediation task page.":::
168
168
169
169
170
170
@@ -175,12 +175,12 @@ For more information on remediation tasks, see [Remediate noncompliant resources
175
175
176
176
Initiatives are collections of policies. There are two sets of intitives for Azure Monitor Diagnostics settings:
177
177
178
-
1. Enable audit category group resource logging
178
+
1. Enable the *audit* category group resource logging
179
179
+[Enable audit category group resource logging for supported resources to Event Hubs](https://portal.azure.com/?feature.customportal=false&feature.canmodifystamps=true&Microsoft_Azure_Monitoring_Logs=stage1&Microsoft_OperationsManagementSuite_Workspace=stage1#view/Microsoft_Azure_Policy/InitiativeDetailBlade/id/%2Fproviders%2FMicrosoft.Authorization%2FpolicySetDefinitions%2F1020d527-2764-4230-92cc-7035e4fcf8a7/scopes~/%5B%22%2Fsubscriptions%2F12345678-aaaa-bbbb-cccc-1234567890ab%22%5D)
180
180
+[Enable audit category group resource logging for supported resources to Log Analytics](https://portal.azure.com/?feature.customportal=false&feature.canmodifystamps=true&Microsoft_Azure_Monitoring_Logs=stage1&Microsoft_OperationsManagementSuite_Workspace=stage1#view/Microsoft_Azure_Policy/InitiativeDetailBlade/id/%2Fproviders%2FMicrosoft.Authorization%2FpolicySetDefinitions%2Ff5b29bc4-feca-4cc6-a58a-772dd5e290a5/scopes~/%5B%22%2Fsubscriptions%2F12345678-aaaa-bbbb-cccc-1234567890ab%22%5D)
181
181
+[Enable audit category group resource logging for supported resources to storage](https://portal.azure.com/?feature.customportal=false&feature.canmodifystamps=true&Microsoft_Azure_Monitoring_Logs=stage1&Microsoft_OperationsManagementSuite_Workspace=stage1#view/Microsoft_Azure_Policy/InitiativeDetailBlade/id/%2Fproviders%2FMicrosoft.Authorization%2FpolicySetDefinitions%2F8d723fb6-6680-45be-9d37-b1a4adb52207/scopes~/%5B%22%2Fsubscriptions%2F12345678-aaaa-bbbb-cccc-1234567890ab%22%5D)
182
182
183
-
1. Enable allLogs category group resource logging
183
+
1. Enable the *allLogs* category group resource logging
184
184
+[Enable allLogs category group resource logging for supported resources to storage](https://portal.azure.com/#view/Microsoft_Azure_Policy/InitiativeDetail.ReactView/id/%2Fproviders%2FMicrosoft.Authorization%2FpolicySetDefinitions%2Fb6b86da9-e527-49de-ac59-6af0a9db10b8/version~/null/scopes~/)
185
185
+[Enable allLogs category group resource logging for supported resources to Event Hub](https://portal.azure.com/#view/Microsoft_Azure_Policy/InitiativeDetail.ReactView/id/%2Fproviders%2FMicrosoft.Authorization%2FpolicySetDefinitions%2F85175a36-2f12-419a-96b4-18d5b0096531/version~/null/scopes/)
186
186
+[Enable allLogs category group resource logging for supported resources to Log Analytics](https://portal.azure.com/#view/Microsoft_Azure_Policy/InitiativeDetail.ReactView/id/%2Fproviders%2FMicrosoft.Authorization%2FpolicySetDefinitions%2F0884adba-2312-4468-abeb-5422caed1038/version~/null/scopes/%5B%22%2Fsubscriptions%2F""%22%22%5D)
@@ -197,37 +197,37 @@ In this example, we assign an initiative for sending audit logs to a Log Analyti
197
197
1. Enter *audit* in the **Search** field.
198
198
1. Select thee *Enable audit category group resource logging for supported resources to Log Analytics* initiative.
199
199
1. On the following page, select **Assign**
200
-
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/initiatives-definitions.png" alt-text="A screenshot showing the initiatives definitions page.":::
The **Parameters** contains the parameters defined in the policy. In this case, we need to select the Log Analytics workspace that we want to send the logs to. For more information in the individual parameters for each policy, see [Policy-specific parameters](#policy-specific-parameters).
208
208
209
209
1. Select the **Log Analytics workspace** to send your audit logs to.
To verify that your policy or initiative assignment is working, create a resource in the subscription or resource group scope that you defined in your policy assignment.
215
215
216
216
After 10 minutes, select the **Diagnostics settings** page for your resource.
217
217
Your diagnostic setting appears in the list with the default name *setByPolicy-LogAnalytics* and the workspace name that you configured in the policy.
218
218
219
-
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/diagnostics-settings.png" alt-text="A screenshot showing the Diagnostics setting page for a resource.":::
219
+
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/diagnostics-settings.png" lightbox="./media/diagnostics-settings-policies-deployifnotexists/diagnostics-settings.png" alt-text="A screenshot showing the Diagnostics setting page for a resource.":::
220
220
221
221
Change the default name in the **Parameters** tab of the **Assign initiative** or policy page by unselecting the **Only show parameters that need input or review** checkbox.
222
222
223
-
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/edit-initiative-assignment.png" alt-text="A screenshot showing the edit-initiative-assignment page with the checkbox unselected.":::
223
+
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/edit-initiative-assignment.png" lightbox="./media/diagnostics-settings-policies-deployifnotexists/edit-initiative-assignment.png" alt-text="A screenshot showing the edit-initiative-assignment page with the checkbox unselected.":::
224
224
225
225
### [PowerShell](#tab/Powershell)
226
226
227
227
228
228
1. Set up your environment variables
229
229
```azurepowershell
230
-
# Set up your environment variables.
230
+
# Set up your environment variables.
231
231
$subscriptionId = <your subscription ID>;
232
232
$rg = Get-AzResourceGroup -Name <your resource group name>;
0 commit comments