az

Commands

az account Manage Azure subscription information.
az ad Manage Azure Active Directory Graph entities needed for Role Based Access Control.
az appconfig Manage App Configurations.
az artifacts Manage Azure Artifacts.
az boards Manage Azure Boards.
az cache Commands to manage CLI objects cached using the `--defer` argument.
az cloud Manage registered Azure clouds.
az configure Manage Azure CLI configuration. This command is interactive.
az devops Manage Azure DevOps organization level operations.
az extension Manage and update CLI extensions.
az feedback Send feedback to the Azure CLI Team!
az find I'm an AI robot, my advice is based on our Azure documentation as well as the usage patterns of Azure CLI and Azure ARM users. Using me improves Azure products and documentation.
az group Manage resource groups and template deployments.
az hdinsight Manage HDInsight resources.
az image Manage custom virtual machine images.
az interactive Start interactive mode. Installs the Interactive extension if not installed already.
az keyvault Manage KeyVault keys, secrets, and certificates.
az lock Manage Azure locks.
az login Log in to Azure.
az logout Log out to remove access to Azure subscriptions.
az network Manage Azure Network resources.
az pipelines Manage Azure Pipelines.
az policy Manage resource policies.
az provider Manage resource providers.
az repos Manage Azure Repos.
az resource Manage Azure resources.
az rest Invoke a custom request.
az role Manage user roles for access control with Azure Active Directory and service principals.
az security Manage your security posture with Azure Security Center.
az self-test Runs a self-test of the CLI.
az storage Manage Azure Cloud Storage resources.
az tag Manage resource tags.
az vm Manage Linux or Windows virtual machines.
az vmss Manage groupings of virtual machines in an Azure Virtual Machine Scale Set (VMSS).

az configure

Manage Azure CLI configuration. This command is interactive.

az configure [--defaults]
[--list-defaults {false, true}]
[--scope {global, local}]

Examples

Set default resource group, webapp and VM names.

az configure --defaults group=myRG web=myweb vm=myvm

Clear default webapp and VM names.

az configure --defaults vm='' web=''

Optional Parameters

--defaults -d

Space-separated 'name=value' pairs for common argument defaults.

--list-defaults -l

List all applicable defaults.

accepted values: false, true
--scope

Scope of defaults. Using "local" for settings only effective under current folder.

accepted values: global, local
default value: global

az feedback

Send feedback to the Azure CLI Team!

az feedback

az find

I'm an AI robot, my advice is based on our Azure documentation as well as the usage patterns of Azure CLI and Azure ARM users. Using me improves Azure products and documentation.

az find []

Examples

Give me any Azure CLI group and I’ll show the most popular commands within the group.

az find 'az storage'

Give me any Azure CLI command and I’ll show the most popular parameters and subcommands.

az find 'az monitor activity-log list'

You can also enter a search term, and I'll try to help find the best commands.

az find 'arm template'

Optional Parameters

<CLI_TERM>

An Azure CLI command or group for which you need an example.

az interactive

Start interactive mode. Installs the Interactive extension if not installed already.

For more information on interactive mode, see: https://azure.microsoft.com/en-us/blog/welcome-to-azure-cli-shell/.

az interactive [--style {bg, br, contrast, default, grey, halloween, neon, none, pastel, primary, purple, quiet}]
[--update]

Optional Parameters

--style -s

The colors of the shell.

accepted values: bg, br, contrast, default, grey, halloween, neon, none, pastel, primary, purple, quiet
--update

Update the Interactive extension to the latest available.

az login

Log in to Azure.

az login [--allow-no-subscriptions]
[--identity]
[--password]
[--service-principal]
[--tenant]
[--use-cert-sn-issuer]
[--use-device-code]
[--username]

Examples

Log in interactively.

az login

Log in with user name and password. This doesn't work with Microsoft accounts or accounts that have two-factor authentication enabled.

az login -u johndoe@contoso.com -p VerySecret

Log in with a service principal using client secret.

az login --service-principal -u http://azure-cli-2016-08-05-14-31-15 -p VerySecret --tenant contoso.onmicrosoft.com

Log in with a service principal using client certificate.

az login --service-principal -u http://azure-cli-2016-08-05-14-31-15 -p ~/mycertfile.pem --tenant contoso.onmicrosoft.com

Log in using a VM's system assigned identity

az login --identity

Log in using a VM's user assigned identity. Client or object ids of the service identity also work

az login --identity -u /subscriptions/<subscriptionId>/resourcegroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myID

Optional Parameters

--allow-no-subscriptions

Support access tenants without subscriptions. It's uncommon but useful to run tenant level commands, such as 'az ad'.

--identity -i

Log in using the Virtual Machine's identity.

--password -p

Credentials like user password, or for a service principal, provide client secret or a pem file with key and public certificate. Will prompt if not given.

--service-principal

The credential representing a service principal.

--tenant -t

The AAD tenant, must provide when using service principals.

--use-cert-sn-issuer

Used with a service principal configured with Subject Name and Issuer Authentication in order to support automatic certificate rolls.

--use-device-code

Use CLI's old authentication flow based on device code. CLI will also use this if it can't launch a browser in your behalf, e.g. in remote SSH or Cloud Shell.

--username -u

User name, service principal, or managed service identity ID.

az logout

Log out to remove access to Azure subscriptions.

az logout [--username]

Optional Parameters

--username

Account user, if missing, logout the current active account.

az rest

Invoke a custom request.

az rest --method {delete, get, head, options, patch, post, put}
--uri
[--body]
[--headers]
[--output-file]
[--resource]
[--skip-authorization-header]
[--subscription]
[--uri-parameters]

Examples

Get Audit log through Microsoft Graph

az rest --method get --uri https://graph.microsoft.com/beta/auditLogs/directoryAudits

Update a Azure Active Directory Graph User's display name

az rest --method patch --uri "https://graph.microsoft.com/v1.0/users/johndoe@azuresdkteam.onmicrosoft.com" --body "{\"displayName\": \"jondoe2\"}"

Required Parameters

--method -m

HTTP request method.

accepted values: delete, get, head, options, patch, post, put
default value: get
--uri -u

Request uri. For uri without host, CLI will assume "https://management.azure.com/". Common tokens will also be replaced with real values including "{subscriptionId}".

Optional Parameters

--body -b

Request body.

--headers

Space-separated headers in KEY=VALUE format or JSON string. Use @{file} to load from a file.

--output-file

Save response payload to a file.

--resource

Resource url for which CLI should acquire a token in order to access the service. The token will be placed in the "Authorization" header. By default, CLI can figure this out based on "--url" argument, unless you use ones not in the list of "az cloud show --query endpoints".

--skip-authorization-header

Do not auto append "Authorization" header.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--uri-parameters

Space-separated queries in KEY=VALUE format or JSON string. Use @{file} to load from a file.

az self-test

Runs a self-test of the CLI.

az self-test [--subscription]

Optional Parameters

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.