Skip to content

Commit f925792

Browse files
committed
hubs workaround2
1 parent fce5ba5 commit f925792

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ To apply a policy using the PowerShell, use the following commands:
131131
New-AzRoleAssignment -Scope $rg.ResourceId -ObjectId $policyAssignment.Identity.PrincipalId -RoleDefinitionId $roleDefId
132132
}
133133
```
134+
1. When assigning policies that send logs to Event Hubs, you must manually add the *Azure Event Hubs Data Owner* permissions for the event hub to your system assigned Managed Identity.
135+
```azurepowershell
136+
New-AzRoleAssignment -Scope /subscriptions/<subscription ID>/resourceGroups/<event hub's resource group> -ObjectId $policyAssignment.Identity.PrincipalId -RoleDefinitionId "Azure Event Hubs Data Owner"
137+
```
134138

135139
1. Scan for compliance, then create a remediation task to force compliance for existing resources.
136140
```azurepowershell
@@ -148,7 +152,7 @@ To apply a policy using the PowerShell, use the following commands:
148152
> When assigning policies that send logs to Event Hubs, you must manually add the *Azure Event Hubs Data Owner* permissions for the event hub to your policy assigned identity.
149153
> Use the `az role assignment create` Azure CLI command.
150154
> ```azurecli
151-
> az role assignment create --assignee <Principal ID> --role "Azure Event > Hubs Data Owner" --scope /subscriptions/<subscription ID>/resourceGroups/<event hub's resource group>
155+
> az role assignment create --assignee <Principal ID> --role "Azure Event Hubs Data Owner" --scope /subscriptions/<subscription ID>/resourceGroups/<event hub's resource group>
152156
>```
153157
> For example:
154158
> ```azurecli

0 commit comments

Comments
 (0)