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
When assigning policies that send logs to event hubs, you must manually add the *Azure Event Hubs Data Owner* role for the event hub to your policy assigned identity.
82
-
83
-
```azurecli
84
-
az role assignment create --assignee <Principal ID> --role "Azure Event Hubs Data Owner" --scope /subscriptions/<subscription ID>/resourceGroups/<event hub's resource group>
85
-
```
79
+
86
80
1. Trigger a scan to find existing resources using [`az policy state trigger-scan`](https://learn.microsoft.com/cli/azure/policy/state?view=azure-cli-latest#az-policy-state-trigger-scan).
87
81
88
82
```azurecli
@@ -137,10 +131,6 @@ To apply a policy using the PowerShell, use the following commands:
When assigning policies that send logs to event hubs, you must manually add the *Azure Event Hubs Data Owner* role for the event hub to your system assigned Managed Identity.
1. Scan for compliance, then create a remediation task to force compliance for existing resources.
146
136
```azurepowershell
@@ -154,20 +144,7 @@ To apply a policy using the PowerShell, use the following commands:
154
144
```
155
145
---
156
146
157
-
> [!Note]
158
-
> When assigning policies that send logs to event hubs, you must manually add the *Azure Event Hubs Data Owner* role for the event hub to your policy assigned identity.
159
-
> Use the `az role assignment create` Azure CLI command.
160
-
> ```azurecli
161
-
> az role assignment create --assignee <Principal ID> --role "Azure Event Hubs Data Owner" --scope /subscriptions/<subscription ID>/resourceGroups/<event hub's resource group>
162
-
>```
163
-
> For example:
164
-
> ```azurecli
165
-
> 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
166
-
>```
167
-
>
168
-
> Find your principal ID on the **Policy Assignment** page, **Managed Identity** tab.
0 commit comments