Rajakumar Babu
Rajakumar Babu

Reputation: 117

Get list out all Azure services in a subscription using powershell

I have an azure subscription and I'm trying to write a powershell script to automatically get a list of all the resources (VMs, Storage Accounts, Databases, etc) that I currently have in my subscription. Is there any way to perform this.

Upvotes: 0

Views: 10304

Answers (3)

Patrick Mawyer
Patrick Mawyer

Reputation: 36

To take this a step further, if you have multiple subscriptions, you can get all resources from all subscriptions using the following command:

get-azurermsubscription | Foreach-object{set-azurermcontext -Subscription $_.SubscriptionId; get-azurermresource}

Upvotes: -1

Uisgebeatha
Uisgebeatha

Reputation: 41

Just as an update; Find-AzureRMResource will actually get you all the resources in a given scope eg. everything in a resource group or subscription. Which may be more useful if you don't want to specify multiple parameters.

https://learn.microsoft.com/en-us/powershell/module/azurerm.resources/find-azurermresource?view=azurermps-4.2.0

Upvotes: 0

Gaurav Mantri
Gaurav Mantri

Reputation: 136196

The PowerShell Cmdlet you're looking for is Get-AzureRMResource. It will list all the resources in your Azure Subscription. It will provide the name, resource id, type, resource group name and location for each and every resource in your Subscription.

Upvotes: 4

Related Questions