Azure Stream Analytics - throwing Unauthorized error

Bee aNad 1 Reputation point
2021-02-03T20:31:02.127+00:00

I am trying to set up Azure Stream Analytics for Eventhub, but it keep throwing error -
Querying EventHub ---eventhubname--- returned an error: Management operation failed. status-code: 401, status-description: Unauthorized..

Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
591 questions
Azure Stream Analytics
Azure Stream Analytics
An Azure real-time analytics service designed for mission-critical workloads.
342 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 84,456 Reputation points Microsoft Employee
    2021-02-04T09:15:13.43+00:00

    Hello @Bee aNad ,

    Welcome to the Microsoft Q&A platform.

    Make sure you had authorized access to Event Hubs resources using Shared Access Signatures.

    Every time you publish or consume events/data from an event hub, your client is trying to access Event Hubs resources. Every request to a secure resource must be authorized so that the service can ensure that the client has the required permissions to publish/consume the data.

    Steps to Grant access to the event hub and get a connection string:

    Before an application can send data to Azure Event Hubs, the event hub must have a policy that allows access. The access policy produces a connection string that includes authorization information.

    Step1: Navigate to the event hub you created in the previous step, MyEventHub. Select Shared access policies under Settings, and then select + Add.

    Step2: Name the policy MyPolicy and ensure Manage is checked. Then select Create.

    63900-image.png

    Reference: Create an Azure Event Hub - Grant access to the event hub and get a connection string section.

    Hope this helps. Do let us know if you any further queries.

    ------------

    • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification.