0
votes

I have created an Event Hub in Azure.

I am trying to gets an Event Hubs description for the specified Event Hub, by following the docs https://docs.microsoft.com/en-us/rest/api/eventhub/eventhubs/get.

When I am hitting the below URL via POSTMAN by replacing the values as specified in docs:

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

But I am getting the following error: -

    {  
    "error": {  
        "code": "AuthenticationFailed",  
        "message": "Authentication failed. The 'Authorization' header is missing."  
    }  
}  

Any idea how to get the description about event hub?

1

1 Answers

0
votes

Because you missed the Bearer token in your request, try to GET the URL below with your Bearer token in the Authorization.

https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourcegroup>/providers/Microsoft.EventHub/namespaces/<yourEventhubName>?api-version=2015-08-01 

Besides, I get my Bearer token via powershell and fiddler, you could refer to the steps.

1.Run the powershell below.

Get-AzureRmResource -ResourceGroupName <ResourceGroupName >-ResourceType Microsoft.EventHub/namespaces -ResourceName "<yourEventHubName>" -ApiVersion 2015-08-01

2.Use fiddler to catch the request, it will send two requests, choose any one, just copy the token.

enter image description here

In the Postman, send the GET with the Bearer token, it works fine on my side.

enter image description here