@Sandhiya Sivakumar If you want to use SAS then you need to use Manage
access to Get the queue description, Enumerate queues, etc. as mentioned in Right required for Service Bus Operation document. If you are using SAS then you should have Manage
access to get the queue/topic/subscription properties or verify if the queue exists etc.
Service bus explorer needs the manage access at the namespace level as there are multiple operations like listing queue/subscription etc that can only be performed using managed access.
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.
-
MayankBargali-MSFT 70,226 Reputation points
2022-01-03T06:21:09.59+00:00