An Azure real-time data ingestion service.
Hi Flavio Duarte,
Thank you for reaching out to the Microsoft QA team. This issue occurs because Azure Monitor diagnostic settings authenticate to Event Hubs at the namespace level, not the individual Event Hub. If the managed identity only has permissions on the Event Hub instance, authentication fails and Event Hub reports User Errors.
1.Assign the role at the Event Hub namespace scope:
az role assignment create \
--assignee <managed_identity_principal_id> \
--role "Azure Event Hubs Data Sender" \
--scope "/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.EventHub/namespaces/<namespace>"
- Verify the diagnostic setting is using Managed Identity:
az monitor diagnostic-settings list --resource <aks_resource_id>
If eventHubAuthorizationRuleId is present, the setting is still using SAS. Recreate the diagnostic setting and select Managed Identity.
3.Wait a few minutes for RBAC changes to propagate.
User Errors metric drops to zero
Logs start flowing normally to Event Hub using managed identity
Hope this helps. Please let us know if you have any questions and concerns.