ServiceBusExplorer
ServiceBusExplorer copied to clipboard
Error when using SAS-policy and connection string with Service Bus Queue
When I use RootManageSharedAccessKey for the Service Bus Namespace I can see everything, see below
When creating a SAS policy (Manage, Send, Listen) on the queue only and connecting using the connection string:
-
<08:55:02> Failed to retrieve Service Bus topics. Exception: Microsoft.ServiceBus.Messaging.MessagingException: Cannot get entity 'my-queue' because it is not of type TopicDescription. Check that you are using method(s) with the correct entity type. ---> System.Runtime.Serialization.SerializationException: Error in line 1 position 2599. Expecting element 'TopicDescription' from namespace 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'.. Encountered 'None' with name '', namespace ''.
-
<Error><Code>401</Code><Detail>User is not authorized. TrackingId:...-...</Detail></Error>
When creating a SAS policy (Manage, Send, Listen) on the topic and working with subscriptions it seems to work:
Anything that I might have missed when connecting to queues?
Thanks for assisting!
For me it does not work with queues nor topics. There are at least two PRs that added/enhanced this funtionality, #375 and #562.
@rajrao and @avdv, does it work for you?
Latest version 5.0.7 also has the same issue "User is not authorized" while using SAS-Policy in Queue, whereas only Topic Subscription works fine.
Any news on this issue? We're facing the same problem.
Based on my local debugging, it seems the issue is caused by the usage of ServiceBusHelper2 in HandleQueueControl and HandleTopicControl constructors.
Basically when you select a queue / topic with a entity level policy it attempts to use the ServiceBusAdministrationClient
(via ServiceBusHelper2
) (and it fails, as expected).
On my local machine, to simply work around this, I've commented the usage of ServiceBusHelper2
in HandleQueueControl
, however I would defer to you for a long term solution, as I'm not familiar enough with the original intentions behind this design.
@ErikMogensen - tagging you since the issue is closed and I'm not sure this is on you radar.
When testing this on the latest commit in the develop branch both connecting to a queue and a topic works for me but I do get tons of error messages in the log window.
Is it only the error messages that is the problem?
It connects successfully, however if you select the topic/queue the view to the right of the tree view doesn't load, and an exception is logged.
@ErikMogensen - not sure if you got the chance to look into this.
@AntonBarwald, @chandraatgithub, @cosminstirbu Please test https://github.com/paolosalvatori/ServiceBusExplorer/releases/tag/5.0.15-preview and report back whether this issue is resolved or not. Please keep an eye out for issues regarding connecting.
Tested the preview version and it fixed the issue. So far so good, didn't find any other issues, although my testing was rather limited.
Thank you!
Happy to read that!