DevOps | Scripts | Automation

Azure CLI

How to get command help in Azure CLI?

To get the help with the commands, you can use the below Microsoft Azure CLI reference link.

https://docs.microsoft.com/en-us/cli/azure/reference-index?view=azure-cli-latest

PowerShell or CMD console (if AZ CLI extension is installed) can also be used to get help with the commands. This article is about the commands help inside the console. If you haven’t installed the AZ CLI tool in your system, please follow the below article.

https://theautomationcode.com/how-to-install-azure-cli/

Once you have the AZ CLI tool installed, just type “AZ” (Without double-quote) inside the console (PowerShell or CMD) to list the commands.

AZ CLI Console

If you need storage-related commands help then use -h after the command to get help related to it. Please note: Like PowerShell TAB doesn’t work for AZ CLI help.

az storage -h

There are subgroups and commands in the output. Subgroups mean you can further extend the command and Commands means action on the current command. You can see the [Preview] ahead of some commands means those commands are for evaluation purposes and can be changed, removed, or kept in the future.

Subgroups example,

az storage account -h
AZ subgroup help

Commands Help,

Az storage account list

The default output will be in JSON format. You can change the output format. The output Format for AZ CLI is explained in the upcoming article.

Another example of AZ CLI help,

az group -h
az group list

In the above two examples, Group is a SubGroup and List is a command. If you are using Interactive mode then like PowerShell ISE it shows the menu for the commands and subgroups. For example,

Az interactive command help

You can use up/down arrow keys to navigate the commands and backspace to close the menu.