question

BeeaNad-0709 avatar image
0 Votes"
BeeaNad-0709 asked ·

Azure Stream Analytics - throwing Unauthorized error

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-hubsazure-stream-analytics
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PRADEEPCHEEKATLA-MSFT avatar image
0 Votes"
PRADEEPCHEEKATLA-MSFT answered ·

Hello @BeeaNad-0709,

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.



image.png (86.7 KiB)
· 4 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The application is able to send the events to eventhub with a send policy only set up.

The problem i am facing is when i try to process the events using the Azure Stream Analytics job in the Process tab under eventhub
64047-image.png


64073-image.png


0 Votes 0 ·
image.png (23.5 KiB)
image.png (35.1 KiB)

Hello @BeeaNad-0709,

When you use this feature for the first time, this page asks for your permission to create a consumer group and a policy for your event hub to preview incoming data.

64492-image.png


Reference: Process data from your event hub using Azure Stream Analytics

Hope this helps.



0 Votes 0 ·
image.png (101.7 KiB)

Hello @BeeaNad-0709,
Just checking in to see if the above answer helped. If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

0 Votes 0 ·
Show more comments