Sandhiya
Sandhiya

Reputation: 65

How to fetch the details of Service Bus Queue using shared access policy (Without Manage Option) connection string?

I have used WindowsAzure.ServiceBus v5 package to access service bus queue details by specifying the SAP connection string and queue name. When the SAP has Send, Listen access but not the Manage Claim option, If I try to check whether the queue exits or not in the service bus it throws the below exception

Exception: AzureServiceBusQueue: Exception raised while checking for the availability of the configured queue: The remote server returned an error: (401) Unauthorized. Manage,EntityRead claims required for this operation.

Code I have used:

var servicebusConnectionString = new ServiceBusConnectionStringBuilder(connectionString)
                {
                    TransportType = TransportType.Amqp
                };
NamespaceManager namespaceManager = NamespaceManager.CreateFromConnectionString(servicebusConnectionString.ToString());
if (namespaceManager.QueueExists(path))
    return true;

Where as If I try the same with SAP connection string that have the access to Manage, I could get the queue details.

Here I am just trying to access/read the details of the queue not going to manage the entity but still, Why I need the Manage operation access?. Is there any solution to overcome this?

Note: In Service Bus Explorer also couldn't get the queue/topic details if its key doesn't have the Manage option.

Upvotes: 0

Views: 295

Answers (1)

Sean Feldman
Sean Feldman

Reputation: 26012

Manage permission is required to access metadata and perform entity operations.

Upvotes: 1

Related Questions