Reputation: 1571
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
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):
Upvotes: 2