@Sinipelto
A System Assigned Managed Identity (MSI) is restricted to its home Azure AD tenant and cannot be granted permissions in another tenant directly. Since Azure RBAC does not support cross-tenant role assignments for MSIs, they cannot be used to access resources in a different tenant.
Cross-tenant access requires authentication using a Service Principal, as MSI cannot be assigned cross-tenant permissions. Since Azure Stream Analytics (ASA)
does not directly support Service Principal authentication in the portal, a User-Assigned Managed Identity (UAMI)
can be used as a bridge to authenticate with the Event Hub in the other tenant.
The ASA job cannot directly use a Service Principal for authentication in the portal. Please follow the below steps:
- Register a Service Principal (App Registration) in the ASA tenant and generate a Client Secret.
- Assign the Service Principal the "
Azure Event Hubs Data Sender
" role in the Event Hub tenant. - Use a
User-Assigned Managed Identity (UAMI)
in ASA and link it to the Service Principal. The ASA job should be configured to authenticate using the UAMI, which in turn uses the Service Principal’s credentials - Configure the ASA job output to use the UAMI, ensuring Private Endpoint connectivity.
Please refer the Microsoft Docs for reference:
https://learn.microsoft.com/en-us/azure/stream-analytics/event-hubs-managed-identity
https://learn.microsoft.com/en-us/azure/event-grid/cross-tenant-delivery-using-managed-identity
Hope this helps. Do let us know if you any further queries. I'm happy to help further.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.