This post shows a Powershell script that connects to Azure and exports all resources from multiple subscriptions to a CSV file. It also shows how this script can be used inside of a scheduled task which creates the CSV file on a daily base.
Exporting all the resources can be achieved with the following commandlets:
Add-AzureRmAccount # login to your azure account Set-AzureRmContext -SubscriptionID $subscriptionId # set/change the subscription Get-AzureRmResource | Export-CSV "c:\temp\data.csv" # get the resources and export it to CSV file
This script just exports the data of one subscription and simply writes it to a csv file. If we want to have a reusable script which exports the data of all of my subscriptions, then we should extend it: