asathuluri
asathuluri

Reputation: 1

Event Hub Error: Catching an exception: status-code: 401, status-description: Unauthorized TrackingId:xxx

I am working on an Azure Function which sends data as a producer to an Event Hub. Azure function is in a different tenant/subscription and Event Hub in a different one. I was able to send data to EventHub from the Functionapp while running a project in my local machine via local-host.

But when i deployed the function to Azure Cloud i am getting the following exception when publishing the data to Eventhub.

Catching an exception: status-code: 401, status-description: Unauthorized TrackingId:XXXX-XXXXX

Event Hub and Function App are in different tenants, different subscriptions. ACL is open between them. Before the ACL is open, got connection closed error and now the above error.

Are any additional firewall or networking updates required on the EventHub?

Thanks in advance.

Upvotes: 0

Views: 1063

Answers (1)

anon
anon

Reputation:

Thank You Anand Sowmithiran for your valuable suggestion. Posting as an Answer to help the other Community Members.

You need to give your function app an Identity, which is then given access by your Event hub(which is on different subscription).


The functionapp does have a system generated identity, should we try adding it to EventHub roles? I doubt if that is needed.

Refer to this Microsoft Blog - Azure Event Hubs support for Azure Active Directory based access control) which guides in using Azure Active Directory (Identity) to control access to Event Hubs.

Upvotes: 1

Related Questions