How to list down all the azure resources viz App services , App service plans , apim , service bus ,cosmos through powershell based on the subscription
The agenda here is to fetch these resources by passing the subscription as a parameter and getting all the respective resources inside that particular subscription.
I know how to fetch the resources using the resource group name as the parameter ,for eg
az appservice plan list [--resource-group]
But here I do not want to fetch based on the resource group , I need to pass the subscription so that all the resources inside that subscription get listed
2
Answers
Using the cli
Using the Az module
AS for viewing just the types so you can make your selection, you can look in the portal URL of the resource or get all types present in your subscription using
In PowerShell using PowerShell Commands:
Firstly, you need to set azure subscription using below PowerShell command:
xxx = Can be subcription name or id
Output:
Then use below PowerShell command to get all resources in the current Subdcription:
Output:
ft means format table