0
votes

I am facing an issue with following Azure API.

GET https://management.azure.com/{resourceUri}/providers/microsoft.insights/metricDefinitions?api-version=2018-01-01

I am trying to access the above API using my Subscription ID in place of resourceUri. But it is throwing the below error:

{ "error": { "code": "MissingSubscription", "message": "The request did not have a provided subscription. All requests must have an associated subscription Id." } }

I have checked in Azure Portal, everything seems fine. The Subscription ID is correct one. The user account have owner permissions. Still getting the error. Not sure of the reason.

Can someone help me out with the most common and basic reasons of this error and steps to resolve this one. Already I have spent couple of hours debugging this one, but no luck.

1

1 Answers

1
votes

I have reproduced your issue, the resourceUri should be the Resource ID instead of the Subscription ID.

Use Subscription ID :

enter image description here

Use Resource ID(in my sample, I use a web app resource id, you could find it in the portal-> your web app -> Properties):

enter image description here

enter image description here