Skip to content

Commit 90219f0

Browse files
committed
final
1 parent b61cc0c commit 90219f0

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

articles/azure-monitor/essentials/diagnostics-settings-policies-deployifnotexists.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Find the role in the policy definition by searching for *roleDefinitionIds*
9292

9393
For example,
9494
```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
9696
```
9797

9898
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:
133133
}
134134
```
135135

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.
137137
```azurepowershell
138138
Start-AzPolicyComplianceScan -ResourceGroupName $rg.ResourceGroupName
139139
Start-AzPolicyRemediation -Name $policyAssignment.Name -PolicyAssignmentId $policyAssignment.PolicyAssignmentId -ResourceGroupName $rg.ResourceGroupName
140140
```
141141

142142
1. Check compliance
143143
```azurepowershell
144-
Get-AzPolicyState -PolicyAssignmentName $policyAssignment.Name -ResourceGroupName $policyAssignment.ResourceGroupName|select-object IsCompliant , ResourceID
144+
Get-AzPolicyState -PolicyAssignmentName $policyAssignment.Name -ResourceGroupName $policyAssignment.ResourceGroupName|select-object IsCompliant, ResourceID
145145
```
146146
---
147147

@@ -159,12 +159,12 @@ To create a remediation task for policies during the policy assignment, select t
159159

160160
To create a remediation task after the policy has been assigned, select your assigned policy from the list on the Policy Assignments page.
161161

162-
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/remediation-after-assignment.png" alt-text="A screenshot showing the policy remediation page.":::
162+
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/remediation-after-assignment.png" lightbox="./media/diagnostics-settings-policies-deployifnotexists/remediation-after-assignment.png" alt-text="A screenshot showing the policy remediation page.":::
163163

164164
Select **Remediate**.
165165
Track the status of your remediation task in the **Remediation tasks** tab of the Policy Remediation page.
166166

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.":::
168168

169169

170170

@@ -175,12 +175,12 @@ For more information on remediation tasks, see [Remediate noncompliant resources
175175

176176
Initiatives are collections of policies. There are two sets of intitives for Azure Monitor Diagnostics settings:
177177

178-
1. Enable audit category group resource logging
178+
1. Enable the *audit* category group resource logging
179179
+ [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)
180180
+ [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)
181181
+ [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)
182182

183-
1. Enable allLogs category group resource logging
183+
1. Enable the *allLogs* category group resource logging
184184
+ [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~/)
185185
+ [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/)
186186
+ [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
197197
1. Enter *audit* in the **Search** field.
198198
1. Select thee *Enable audit category group resource logging for supported resources to Log Analytics* initiative.
199199
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.":::
200+
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/initiatives-definitions.png" lightbox="./media/diagnostics-settings-policies-deployifnotexists/initiatives-definitions.png" alt-text="A screenshot showing the initiatives definitions page.":::
201201

202202
1. On the **Basics** tab of the **Assign initiative** page, select a **Scope** that you want the initiative to apply to.
203203
1. Enter a name in the **Assignment name** field.
204204
1. Select the **Parameters** tab.
205-
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/assign-initiatives-basics.png" alt-text="A screenshot showing the assign initiatives basics tab.":::
205+
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/assign-initiatives-basics.png" lightbox="./media/diagnostics-settings-policies-deployifnotexists/assign-initiatives-basics.png" alt-text="A screenshot showing the assign initiatives basics tab.":::
206206

207207
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).
208208

209209
1. Select the **Log Analytics workspace** to send your audit logs to.
210210

211211
1. Select **Review + create** then **Create**
212-
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/assign-initiatives-parameters.png" alt-text="A screenshot showing the assign initiatives parameters tab.":::
212+
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/assign-initiatives-parameters.png" lightbox="./media/diagnostics-settings-policies-deployifnotexists/assign-initiatives-parameters.png" alt-text="A screenshot showing the assign initiatives parameters tab.":::
213213

214214
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.
215215

216216
After 10 minutes, select the **Diagnostics settings** page for your resource.
217217
Your diagnostic setting appears in the list with the default name *setByPolicy-LogAnalytics* and the workspace name that you configured in the policy.
218218

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.":::
220220

221221
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.
222222

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.":::
224224

225225
### [PowerShell](#tab/Powershell)
226226

227227

228228
1. Set up your environment variables
229229
```azurepowershell
230-
# Set up your environment variables.
230+
# Set up your environment variables.
231231
$subscriptionId = <your subscription ID>;
232232
$rg = Get-AzResourceGroup -Name <your resource group name>;
233233
Select-AzSubscription $subscriptionId;
@@ -277,7 +277,7 @@ Log Analytics*, ResourceID "/providers/Microsoft.Authorization/policySetDefinit
277277
278278
1. Check the compliance state when the remediation tasks have completed.
279279
```azurepowershell
280-
Get-AzPolicyState -PolicyAssignmentName $assignmentName -ResourceGroupName $rg.ResourceGroupName|select-object IsCompliant , ResourceID
280+
Get-AzPolicyState -PolicyAssignmentName $assignmentName -ResourceGroupName $rg.ResourceGroupName|select-object IsCompliant, ResourceID
281281
```
282282
283283
You can get your policy assignment details using the following command:
@@ -388,7 +388,7 @@ This policy deploys a diagnostic setting using a category group to route logs to
388388
|resourceLocation|Resource Location must be in the same location as the Storage Account|Supported locations|
389389
|storageAccount|Storage Account resourceId|||
390390
391-
## Supported Resources
391+
## Supported resources
392392
393393
Built-in All logs and Audit logs policies for Log Analytics workspaces, Event Hubs, and Storage Accounts exist for the following resources:
394394

null/scopes

Whitespace-only changes.

0 commit comments

Comments
 (0)