简体   繁体   English

在C#中使用SAS密钥获取Azure Service Bus描述

[英]Get Azure Service Bus description with SAS key in c#

My project is trying to get various metadata about an Azure ServiceBus. 我的项目正在尝试获取有关Azure ServiceBus的各种元数据。 Currently, I am trying to get the ServiceBus Location, and the AccessRghts associated with the SAS key that is being used as auth. 当前,我正在尝试获取ServiceBus位置以及与正用作身份验证的SAS密钥关联的AccessRghts。

My project is using the old C# SDK (Microsoft.ServiceBus). 我的项目正在使用旧的C#SDK(Microsoft.ServiceBus)。

There is a NamespaceDescrition Class in the SDK, which contains half the information I need, and a ConnectionDetail Class which contains the other half, but I cannot find any methods that would return either of these objects. SDK中有一个NamespaceDescrition类 ,其中包含我需要的一半信息,而ConnectionDetail类中包含另一半信息,但是我找不到任何会返回这些对象中任何一个的方法。 They both have empty constructors, so obviously I could create the objects, but I assume that won't populate them with data! 它们都有空的构造函数,所以很明显我可以创建对象,但是我想不会用数据填充它们!

How do I get a populated copy of these objects? 如何获得这些对象的填充副本?

You can make use of Microsoft.Azure.Management.ServiceBus.Fluent library. 您可以使用Microsoft.Azure.Management.ServiceBus.Fluent库。 This is authorized using Service Principal . 这是使用Service Principal授权的。

This library provides you methods to fetch Namespace details like location, resource group, etc. There are methods available for fetching the SAS keys of the namespaces. 该库为您提供了获取名称空间详细信息(例如位置,资源组等)的方法。有些方法可用于获取名称空间的SAS密钥。 In addition CRUD operations can be performed with the Namespaces and Entities under it. 另外,CRUD操作可以在其下的命名空间和实体下执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 C# 获取总线报告的设备描述 - How to get Bus Reported Device Description using C# 使用 C# 通过 SessionId 获取 Azure 服务总线队列活动消息计数 - get Azure Service Bus Queue active message count by SessionId using C# 在 C# 中,如何从 Azure 服务总线队列中获取所有消息? - In C#, How can I get ALL the messages out of an Azure Service Bus Queue? 如何使用 C# 以编程方式与 Azure 服务总线通信 - How to Communicate with Azure Service Bus Programmatically using C# 在 C# 中使用 azure 服务总线的指数退避 - Exponential backoff using azure service bus in C# 从 Azure 服务总线主题到 C# 删除订阅 - Deleting subscriptions from Azure Service Bus Topic through C# Azure服务总线序列化问题[C#/ JAVA] - Azure Service Bus Serialization Issues [C# / JAVA] C#Azure服务总线队列OnMessage回调 - C# Azure Service Bus Queue OnMessage Callback 如何通过代理连接到 Azure 服务总线主题 - C#? - How to connect to Azure Service Bus Topic through proxy - C#? C# - 天蓝色函数服务总线消息接受一条消息作为 ServiceBusReceivedMessage - C# - azure function service bus message accept a message as ServiceBusReceivedMessage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM