az alias

Manage Azure CLI Aliases.

Commands

az alias create

Create an alias.

az alias export

Export all registered aliases to a given path, as an INI configuration file. If no export path is specified, the alias configuration file is exported to the current working directory.

az alias import

Import aliases from an INI configuration file or an URL.

az alias list

List the registered aliases.

az alias remove

Remove one or more aliases. Aliases to be removed are space-delimited.

az alias remove-all

Remove all registered aliases.

az alias create

Create an alias.

az alias create --command
                --name

Examples

Create simple alias commands.

az alias create --name rg --command group

az alias create --name ls --command list

Create a complex alias.

az alias create --name list-vm --command 'vm list --resource-group myResourceGroup'

Create an alias command with arguments.

az alias create --name 'list-vm {{ resource_group }}' \
  --command 'vm list --resource-group {{ resource_group }}'

Process arguments using Jinja2 templates.

az alias create --name 'storage-ls {{ url }}' \
  --command 'storage blob list
    --account-name {{ url.replace("https://", "").split(".")[0] }}
    --container-name {{ url.replace("https://", "").split("/")[1] }}'

Required Parameters

--command -c

The command that the alias points to.

--name -n

The name of the alias.

az alias export

Export all registered aliases to a given path, as an INI configuration file. If no export path is specified, the alias configuration file is exported to the current working directory.

az alias export [--exclude]
                [--path]

Optional Parameters

--exclude -e

Space-separated aliases excluded from export.

--path -p

The path of the alias configuration file to export to.

az alias import

Import aliases from an INI configuration file or an URL.

az alias import --source

Required Parameters

--source -s

The source of the aliases to import from.

az alias list

List the registered aliases.

az alias list

az alias remove

Remove one or more aliases. Aliases to be removed are space-delimited.

az alias remove --name

Required Parameters

--name -n

Space-separated aliases.

az alias remove-all

Remove all registered aliases.

az alias remove-all [--yes]

Optional Parameters

--yes -y

Do not prompt for confirmation.