【问题标题】:How to fetch the details of Service Bus Queue using shared access policy (Without Manage Option) connection string?如何使用共享访问策略(无管理选项)连接字符串获取服务总线队列的详细信息?
【发布时间】:2022-01-27 17:15:14
【问题描述】:

我已使用WindowsAzure.ServiceBus v5 包通过指定 SAP 连接字符串和队列名称来访问服务总线队列详细信息。当 SAP 具有 Send, Listen 访问权限但没有 Manage 声明选项时,如果我尝试检查队列是否在服务总线中退出,则会引发以下异常

例外: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.

我使用过的代码:

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

如果我尝试使用有权访问Manage 的 SAP 连接字符串,我可以获得队列详细信息。

在这里,我只是尝试访问/读取队列的详细信息,而不是管理实体,但仍然,为什么我需要管理操作访问权限?。有什么办法可以克服吗?

注意:如果其键没有“管理”选项,则在 Service Bus Explorer 中也无法获取队列/主题详细信息。

【问题讨论】:

    标签: .net azure connection-string azureservicebus azure-servicebus-queues


    【解决方案1】:

    访问元数据和执行实体操作需要管理权限。

    【讨论】:

      猜你喜欢
      • 2015-02-17
      • 2021-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多