In Azure powershell set output to table format instead of json

Viewed 493

In Azure powershell, the json format is annoying at times. Need to scroll backwards and de-crypt .

How do i change the default to be --output table for all az commands?

2 Answers

In Azure powershell, type the following inorder-to change the default output to table

az configure

it will prompt you with following question. Select 3

Do you wish to change your settings? (y/N): y

What default output format would you like?
 [1] json - JSON formatted output that most closely matches API responses.
 [2] jsonc - Colored JSON formatted output that most closely matches API responses.
 [3] table - Human-readable output format.
..
Please enter a choice [Default choice(1)]: 3

This is for users who doesn't like the default json format

Since you've given a solution on how to configure default table output for Azure CLI, this question should also have a solution for Azure PowerShell.

The easiest solution I can think of is just piping the output to Format-Table e.g. Get-AzResourceGroup | Format-Table -AutoSize.

You can have a look for more information at Format Azure PowerShell cmdlet output.

Related