1
votes

I am using Microsoft Azure Resource Manager API https://docs.microsoft.com/en-us/rest/api/resources/resources/listbyresourcegroup I am able to pull all event hub namespaces under particular Subscription & resource group . But I am unable to pull event hub instances details like , event hub connection string and name of availabile event hub instances.

1

1 Answers

1
votes

Seams that there is no such option in the rest api you mentioned.

You should use the following apis for fetching event hub connection string and name of event hub instances respectively.

  1. For names of event hub instances, use this api, you need to specify the namespce:

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs?api-version=2017-04-01

  1. For connection strings, use this api. You should specify namespace / event hub name / connection string name:

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/ListKeys?api-version=2017-04-01

Response for connection string of event hub:

enter image description here

Hope it helps.