Yutao Huang
Yutao Huang

Reputation: 1571

Azure Resource Management API to directly return the number of resources within a subscription or resource group?

Is there an Azure Resource Management API to directly get the number of resources (preferably can be filtered by certain criteria like resource types) within a subscription or resource group?

I know there are ARM APIs to get a list of resources within a subscription or resource group (this and that). But I don't want to retrieve a huge list (potentially paginated) just to count the number of items.

Upvotes: 0

Views: 418

Answers (1)

maras2002
maras2002

Reputation: 311

Use Resource Graph API, something documented here: https://learn.microsoft.com/en-us/rest/api/azureresourcegraph/resourcegraph(2021-03-01)/resources/resources#filter-resources


Using UI (example only here):

enter image description here

Upvotes: 2

Related Questions