1

Via the Azure Portal, I can see which Relays are connected and how many listeners they have. I'd like to do this programmatically so that I can know which connections I have and whether or not there is anyone is listening on them.

Thanks!

Jeffrey Lott
  • 7,171
  • 6
  • 28
  • 28

1 Answers1

3

As I know we can use Rest API to get the listeners and relays. I test it with fiddler, it works correctly more details please refer to the snapshot.

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

If we want to get a WcfRelay, we need to supply a WcfRelay name.

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

enter image description here

Detail info on the Azure portal

enter image description here

Tom Sun - MSFT
  • 24,161
  • 3
  • 30
  • 47
  • What do I need to do to get a bearer token for the management api? – Jeffrey Lott Mar 09 '17 at 16:02
  • If you use C# code, please refer to another [SO Thread](http://stackoverflow.com/questions/41260442/azure-api-authentication?answertab=active#tab-top) to get more info about API Authentication. – Tom Sun - MSFT Mar 10 '17 at 01:23