top of page

Export Azure Resources to CSV files with PowerShell

To export the list of Azure resources to excel, you need to take help of Azure Cmdlet PowerShell Script. Using the PowerShell script, you can easily export the Azure subscription inventory. We need to take help of two cmdlet to achieve this.

The Get-AzureRmResource cmdlet gets Azure resources for the selected subscription, and The Export-Csv cmdlet helps in export data as a comma-separated values (CSV) file. Thereafter you can open the same using Excel for your further data manipulation.

If you've ever had a need to create a CSV file of various Azure Resources for reports, etc. than this post is for you. I'm going to quickly show you how to generate a CSV file with PowerShell that lists VMs in the active subscription along with a couple of additional details.

Start with typing Install-Module -Name AzureRM and follow along with the prompts below. You may also install the update if you wish, but this should work fine in 5.x.

Then, run the Import-Module AzureRM command and then type A as shown below:

If you aren't in the working subscription where you have your resources then you might have to type Set-AzureRmContext -SubscriptionId <SubId> where SubId is the subscription id that you want to query.

Now add the following in your PowerShell window

You can now open this CSV file in Excel and use a ; delimeter to format each item into columns.

TRADEMARK LEGAL NOTICE All product names, logos, and brands are property of their respective owners in the Austria or other countries.All company, product and service names used on this website are for identification purposes only. Pheniix is notaffiliated with or an official partner of Cisco, CompTIA,Dimension Data, VMware, Amazon, Microsoft, Certified Ethical Hacker, (ISC)², Juniper, Wireshark, Offensive Security,Google, GNS3, F5, Python, Linux, Java, Openstack, Vagrant, Ansible, Docker, GIT, , Blockchain or other companies.Use of these names, logos, and brands does not imply endorsement.The opinions expressed on pheniix are personal perspectives and not those of Cisco , Dimension Data or any other company. Pheniix runs as an independent blog.

#PowerShell #MicrosoftAzure #Microsoft #AzureRM #Cmdlet #Script

bottom of page