im getting "unauthorized" status code 401 although i added the neccessary permissions

gumi 20 Reputation points
2025-01-09T14:16:28.9533333+00:00

im trying to send logs from my storage to an event hub by using logic app.

i added the permission "Azure Event Hubs Data Sender" to the logic app (managed identity).

im getting "unauthorized" status code 401 on the last step, which is event hub send event:

{  "status": 401,  "message": "Unauthorized access. 'Send' claim(s) are required to perform this operation. Resource: 'sb://XXX2XXXX.servicebus.windows.net/XXXXeh'. TrackingId:90a2a38ab3cd47f6a9db0e42f7f8d3b9_G9, SystemTracker:gateway5, Timestamp:2025-01-09T13:52:51, referenceId: 90a2a38ab3cd47f6a9db0e42f7f8d3b9_G9\r\nclientRequestId: e7cf4d34-e49c-409b-a7c7-85e600143791",  "error": {    "message": "Unauthorized access. 'Send' claim(s) are required to perform this operation. Resource: 'sb://XXXX2XXXXX.servicebus.windows.net/catoeh'. TrackingId:90a2a38ab3cd47f6a9db0e42f7f8d3b9_G9, SystemTracker:gateway5, Timestamp:2025-01-09T13:52:51, referenceId: 90a2a38ab3cd47f6a9db0e42f7f8d3b9_G9"  },  "source": "eventhubs-ic.azconn-ic-001.p.azurewebsites.net"}

User's imageUser's image

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,304 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
671 questions
{count} votes

Accepted answer
  1. VenkateshDodda-MSFT 23,441 Reputation points Microsoft Employee
    2025-01-15T04:01:30.5633333+00:00

    @gumi

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue: getting 401 unauthorized when trying to send event to eventhub using logic apps managed identity.

    Solution:

    Customer has added the action for "send event" added an event hub connection string, the issue was they had added the connection string of the specific event hub instead of the event hub name space (should not include entity error massage).

    If you have any other questions or are still running into more issues, please let me know. Thank you again for your time and patience throughout this issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. gumi 20 Reputation points
    2025-01-13T13:55:12.1466667+00:00

    I found the problem,

    at first when i added the action for "send event" i also added an event hub connection string, the issue was that i added the connection string of the specific event hub instead of the event hub name space (should not include entity error massage).

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.