Skip to content

Commit fce5ba5

Browse files
committed
hubs workaround
1 parent ea8a4c0 commit fce5ba5

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,24 @@ To apply a policy using the PowerShell, use the following commands:
143143
Get-AzPolicyState -PolicyAssignmentName $policyAssignment.Name -ResourceGroupName $policyAssignment.ResourceGroupName|select-object IsCompliant , ResourceID
144144
```
145145
---
146+
147+
> [!Important]
148+
> 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.
149+
> Use the `az role assignment create` Azure CLI command.
150+
> ```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>
152+
>```
153+
> For example:
154+
> ```azurecli
155+
> az role assignment create --assignee xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --role "Azure Event Hubs Data Owner" --scope /subscriptions/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy/resourceGroups/myResourceGroup
156+
>```
157+
>
158+
> Find your principal ID on the **Policy Assignment** page, **Managed Identity** tab.
159+
> :::image type="content" source="./media/diagnostics-settings-policies-deployifnotexists/find-principal.png" alt-text="{alt-text}":::
160+
161+
162+
163+
146164
## Remediation tasks
147165
148166
Policies are applied to new resources when they're created. To apply a policy to existing resources, create a remediation task. Remediation tasks bring resources into compliance with a policy.
69.5 KB
Loading

0 commit comments

Comments
 (0)