Need an API to get all the non-hidden resources from the azure subscription.

Rajat Saxena (NON EA SC ALT) 41 Reputation points
2022-11-01T13:25:15.92+00:00

Hi team,

I have a requirement where I need an API to get all the non-hidden resources from the subscription. I have gone through the documentation and find an API: GET https://management.azure.com/subscriptions/{subscriptionId}/resources?api-version=2021-04-01 which gives all the resources from the subscription, but it also contains hidden resources and I’m not able to figure out how to differentiate hidden resources from the response as no unique identifier/flag is present for hidden/non-hidden resource.

Thanks!

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,224 questions
0 comments No comments
{count} votes

Accepted answer
  1. JananiRamesh-MSFT 22,956 Reputation points
    2022-11-01T14:10:36.763+00:00

    Hi @Rajat Saxena (NON EA SC ALT) Thanks for reaching out. Currently its only supported in the Azure portal, the user can choose to include or exclude hidden resources in the list by checking the box.
    The rest api call GET https://management.azure.com/subscriptions/{subscriptionId}/resources?api-version=2021-04-01 provides all the resources under the subscription we don't have any filter query that allows any sort of "hidden" property to be passed to filter on the server either through rest api call / Az powershell command.

    we have the following github threads discussing the same,
    https://github.com/Azure/azure-powershell/issues/10365
    https://github.com/Azure/azure-powershell/issues/9102

    feel free to provide your feedback at our feedback forum https://feedback.azure.com/d365community/ so that other users who are in need to similar feature can upvote it and Product group team can take it forward.

    let me know incase in of further queries, I would be happy to assist you.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful