skip to Main Content

How to export the azure resources to csv file, using azure CLI?

I’m new to azure.

2

Answers


  1. To get list of resources you can use:

    az resource list

    you can add --out switch and use the following formats: json, jsonc, yaml, yamlc, table, tsv but not CSV.

    In bash you can try something like this to convert tsv to csv:

    az resource list --out tsv | sed 's/t/,/g'

    or with PowerShell as described here.

    Login or Signup to reply.
  2. You can use the below comdlet in azure powershell:

    This is an aternative workaround from powershell to export resources in csv file :

    Get-AzResource | Export-Csv -Path "C:NewFoldertest.csv"
    

    enter image description here

    Output:

    enter image description here

    References taken from:

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search