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
+37-38Lines changed: 37 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Enable Diagnostics settings by category group using built-in policies.
2
+
title: Enable diagnostics settings by category group using built-in policies.
3
3
description: Use Azure builtin policies to create diagnostic settings in Azure Monitor.
4
4
author: EdB-MSFT
5
5
ms.author: edbaynash
@@ -31,7 +31,7 @@ The following steps show how to apply the policy to send audit logs to for key v
31
31
1. Select **Monitoring** from the Category dropdown
32
32
1. Enter *keyvault* in the **Search** field.
33
33
1. Select the **Enable logging by category group for Key vaults (microsoft.keyvault/vaults) to Log Analytics** policy,
34
-
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/policy-definitions.png" alt-text="A screenshot of the policy definitions page":::
34
+
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/policy-definitions.png" alt-text="A screenshot of the policy definitions page.":::
35
35
1. From the policy definition page, select **Assign**
36
36
1. Select the **Parameters** tab.
37
37
1. Select the Log Analytics Workspace that you want to send the audit logs to.
@@ -101,48 +101,47 @@ For more information on policy assignment using CLI, see [Azure CLI reference -
101
101
To apply a policy using the PowerShell, use the following commands:
102
102
103
103
1. Set up your environment.
104
-
Select your subscription and set your resource group
105
-
```azurepowershell
106
-
Select-AzSubscription <subscriptionID>
107
-
$rg = Get-AzResourceGroup -Name <resource groups name>
108
-
```
104
+
Select your subscription and set your resource group
105
+
```azurepowershell
106
+
Select-AzSubscription <subscriptionID>
107
+
$rg = Get-AzResourceGroup -Name <resource groups name>
108
+
```
109
109
110
110
1. Get the policy definition and configure the parameters for the policy. In the example below we assign the policy to send keyVault logs to a Log Analytics workspace
111
-
```azurepowershell
112
-
$definition = Get-AzPolicyDefinition |Where-Object Name -eq 6b359d8f-f88d-4052-aa7c-32015963ecc1
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).
197
196
198
197
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.
204
203
205
204
After 10 minutes, select the **Diagnostics settings** page for your resource.
206
-
Your diagnostic setting appears in the list with the default name *setByPolicy-LogAnalytics and the workspace name that you configured in the policy.
205
+
Your diagnostic setting appears in the list with the default name *setByPolicy-LogAnalytics* and the workspace name that you configured in the policy.
207
206
208
207
:::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/diagnostics-settings.png" alt-text="A screenshot showing the Diagnostics setting page for a resource.":::
0 commit comments