Azure BOM Export

Handian Sudianto 6,101 Reputation points
2023-09-22T07:07:17.6833333+00:00

Hello,

Can we export all azure resources (vm specification, db specification, storage account specification) to csv files?

Azure SQL Database
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,045 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,969 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 34,101 Reputation points Volunteer Moderator
    2023-09-22T14:50:36.0033333+00:00

    Go to the Azure portal:

    • Go to the All resources page
    • Click the Export to CSV button
    • In the Export options dialog box, select the resources you want to export
    • Click Export

    Or if you are familiar with PowerShell, you can use the following script:

    # Get all Azure resources in the current subscription.
    $resources = Get-AzResource
    # Export the resources to a CSV file.
    $resources | Export-Csv -Path "C:\Temp\AzureResources.csv" -NoTypeInformation
    

    To export all Azure SQL Databases to a CSV file :

    # Get all Azure SQL Databases in the current subscription.
    $databases = Get-AzSqlDatabase
    # Export the databases to a CSV file.
    $databases | Export-Csv -Path "C:\Temp\AzureSqlDatabases.csv" -NoTypeInformation
    

    For Azure Virtual Machines:

    # Get all Azure Virtual Machines in the current subscription.
    $vms = Get-AzVM
    # Export the VMs to a CSV file.
    $vms | Export-Csv -Path "C:\Temp\AzureVMs.csv" -NoTypeInformation
    

    For Azure App Service:

    # Get all Azure App Services in the current subscription.
    $appServices = Get-AzWebApp
    # Export the App Services to a CSV file.
    $appServices | Export-Csv -Path "C:\Temp\AzureAppServices.csv" -NoTypeInformation
    

    Don't forget the Azure Resource Graph Explorer, it can help you a lot.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.