我能否以编程方式获取 Azure 服务总线中继的列表以及它们有多少侦听器?

Can I programmatically get a list of Azure Service Bus Relays and how many listeners they have?

通过 Azure 门户,我可以看到连接了哪些中继以及它们有多少侦听器。我想以编程方式执行此操作,以便我可以知道我有哪些连接以及是否有人在监听它们。

谢谢!

据我所知,我们可以使用 Rest API 来获取监听器和中继。我用fiddler测试过,可以正常使用更多细节请参考快照。

https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourcegroup}/providers/Microsoft.Relay/namespaces/{namspace}/WcfRelays?api-version=2016-07-01

如果我们想要获得一个 WcfRelay,我们需要提供一个 WcfRelay 名称。

https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourcegroup}/providers/Microsoft.Relay/namespaces/{namspace}/WcfRelays/{WcfRelayName}?api-version=2016-07-01

Azure 门户的详细信息