I created service bus with the queue, but when I try to test via POSTMAN I am getting 401

Martin Orator 20 Reputation points
2023-04-06T08:07:06.0066667+00:00
Using POST method
Headers Authorization with Primary key from my SAS Policy, but it looks it expects Token.
Where to take the token to connect to my Service Bus queue?
Thanks a lot in advance for any help.



Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
649 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,361 Reputation points
    2023-04-06T16:28:15.2666667+00:00

    Martin Orator Thanks for posting your question in Microsoft Q&A. Based on your description, you have configured Shared Access Authorization Policies for your SB queue and would need to generate SAS token with the format as below. Refer Generate a Shared Access Signature token doc for more info on this.

    SharedAccessSignature sig=<signature-string>&se=<expiry>&skn=<keyName>&sr=<URL-encoded-resourceURI>
    
    

    Since you are using Postman tool, I would suggest reviewing similar discussion: https://learn.microsoft.com/en-us/answers/questions/755140/how-to-read-azure-service-bus-queue-message-from-. The discussion points to article: https://medium.com/javarevisited/send-message-to-azure-service-bus-via-postman-using-sas-token-in-1-step-a845686baad0 with detailed step by step instructions for Postman. Note, you may face 401 Unauthorized error if there is an issue with the format of signature sent to Rest API. If so, please share the detailed error message and exception. I hope this helps with your questions and let me know if you have any questions.

    If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.

    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.