Discrepencies in Azure API versions for 'Get Resource List', 'Get Metrics Definition List' and 'Get Metrics Data' API endpoints

sulay shah 1 Reputation point
2022-12-09T20:41:36.337+00:00

For the three Azure API endpoints given below, we have found some discrepancies in the API versions where some versions seem to be misrepresented in the documentation as well as undocumented API versions which seem more recent. We would like to confirm with Microsoft Azure team on which API versions to use.

The API endpoints in question are as follows -

Get resources list (Resources - Resources - REST API (Azure Azure Resource Graph) - https://learn.microsoft.com/en-us/rest/api/azureresourcegraph/resourcegraph(2020-04-01-preview)/resources/resources?tabs=HTTP

Get Metric Definitions list (Metric Definitions - List - REST API (Azure Monitor) - https://learn.microsoft.com/en-us/rest/api/monitor/metric-definitions/list?tabs=HTTP

Get metrics data (Metrics - List - REST API (Azure Monitor) - https://learn.microsoft.com/en-us/rest/api/monitor/metrics/list?tabs=HTTP

Regarding the API endpoint Get resources list , according to the Microsoft Learn (https://learn.microsoft.com/en-us/rest/api/azureresourcegraph/resourcegraph(2020-04-01-preview)/resources/resources?tabs=HTTP) the latest api version is 2020-04-01-preview. When running a request using postman it resulted us with the list of supported api versions in the response which are not mentioned in the Microsoft Learn.

To summarise, the latest api version according to the doc is 2020-04-01-preview and latest api version using the postman request is 2022-10-01 (undocumented) for getting list of resources.

Similar is the case for the other two endpoints as well. The latest api version according to the doc is 2018-01-01 and latest api version using the postman request is 2021-05-01 for getting list of Metric Definitions and metrics data as well.

So, it seems like there are more recent but undocumented APIs from Azure. And the one with preview just sounds like a documentation error. We want to confirm the actual version with the Azure team.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,408 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 29,481 Reputation points Microsoft Employee
    2022-12-19T06:16:18.41+00:00

    Hi @sulay shah , the REST API documentation is published automatically as the API receives updates. With regards to:

    it seems like there are more recent but undocumented APIs from Azure

    There is a possibility of that as teams continuously work to improve the REST API. However, it should not be treated consumable but only exploratory

    Nevertheless, I used the portal to see what api-version it was using and confirmed it's using 2021-03-01. Anything with -preview I would use cautiously as the spec for that endpoint is subject to change. Now, I wasn't able to reproduce your body response with passing { "query" : "" } and this sample query.

    Feel free to comment down below with the body you used to call the API endpoint. I would also be curious to know if you get the same result using the Try It feature on the API documentation.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.