az
Commands
az account |
Manage Azure subscription information. |
az acr |
Manage private registries with Azure Container Registries. |
az ad |
Manage Azure Active Directory Graph entities needed for Role Based Access Control. |
az advisor |
Manage Azure Advisor. |
az aks |
Manage Azure Kubernetes Services. |
az apim |
Manage Azure API Management services. |
az appconfig |
Manage App Configurations. |
az appservice |
Manage App Service plans. |
az aro |
Manage Azure Red Hat OpenShift clusters. |
az artifacts |
Manage Azure Artifacts. |
az backup |
Manage Azure Backups. |
az batch |
Manage Azure Batch. |
az boards |
Manage Azure Boards. |
az cache |
Commands to manage CLI objects cached using the |
az cloud |
Manage registered Azure clouds. |
az cognitiveservices |
Manage Azure Cognitive Services accounts. |
az config |
Manage Azure CLI configuration. |
az configure |
Manage Azure CLI configuration. This command is interactive. |
az cosmosdb |
Manage Azure Cosmos DB database accounts. |
az deployment |
Manage Azure Resource Manager template deployment at subscription scope. |
az deployment-scripts |
Manage deployment scripts at subscription or resource group scope. |
az deploymentmanager |
Create and manage rollouts for your service. |
az devops |
Manage Azure DevOps organization level operations. |
az disk |
Manage Azure Managed Disks. |
az disk-access |
Manage disk access resources. |
az disk-encryption-set |
Disk Encryption Set resource. |
az eventhubs |
Manage Azure Event Hubs namespaces, eventhubs, consumergroups and geo recovery configurations - Alias. |
az extension |
Manage and update CLI extensions. |
az feature |
Manage resource provider features. |
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 functionapp |
Manage function apps. To install the Azure Functions Core tools see https://github.com/Azure/azure-functions-core-tools. |
az group |
Manage resource groups and template deployments. |
az hdinsight |
Manage HDInsight resources. |
az image |
Manage custom virtual machine images. |
az iot |
Manage Internet of Things (IoT) assets. |
az keyvault |
Manage KeyVault keys, secrets, and certificates. |
az kusto |
Manage Azure Kusto resources. |
az local-context |
Manage Local Context. |
az lock |
Manage Azure locks. |
az login |
Log in to Azure. |
az logout |
Log out to remove access to Azure subscriptions. |
az managedservices |
Manage the registration assignments and definitions in Azure. |
az monitor |
Manage the Azure Monitor Service. |
az mysql |
Manage Azure Database for MySQL servers. |
az netappfiles |
Manage Azure NetApp Files (ANF) Resources. |
az network |
Manage Azure Network resources. |
az openshift |
Manage Azure Red Hat OpenShift Services. |
az pipelines |
Manage Azure Pipelines. |
az policy |
Manage resource policies. |
az postgres |
Manage Azure Database for PostgreSQL servers. |
az ppg |
Manage Proximity Placement Groups. |
az provider |
Manage resource providers. |
az redis |
Manage dedicated Redis caches for your Azure applications. |
az relay |
Manage Azure Relay Service namespaces, WCF relays, hybrid connections, and rules. |
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 search |
Manage Azure Search services, admin keys and query keys. |
az security |
Manage your security posture with Azure Security Center. |
az self-test |
Runs a self-test of the CLI. |
az servicebus |
Manage Azure Service Bus namespaces, queues, topics, subscriptions, rules and geo-disaster recovery configuration alias. |
az sf |
Manage and administer Azure Service Fabric clusters. |
az signalr |
Manage Azure SignalR Service. |
az snapshot |
Manage point-in-time copies of managed disks, native blobs, or other snapshots. |
az sql |
Manage Azure SQL Databases and Data Warehouses. |
az staticwebapp |
Manage static apps. |
az storage |
Manage Azure Cloud Storage resources. |
az synapse |
Manage and operate Synapse Workspace, Spark Pool, SQL Pool. |
az tag |
Tag Management on a resource. |
az upgrade |
Upgrade Azure CLI and extensions. |
az version |
Show the versions of Azure CLI modules and extensions in JSON format by default or format configured by --output. |
az vm |
Manage Linux or Windows virtual machines. |
az vmss |
Manage groupings of virtual machines in an Azure Virtual Machine Scale Set (VMSS). |
az webapp |
Manage web apps. |
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
Space-separated 'name=value' pairs for common argument defaults.
List all applicable defaults.
Scope of defaults. Using "local" for settings only effective under current folder.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az feedback
Send feedback to the Azure CLI Team!
az feedback
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
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 [<CLI_TERM>]
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
An Azure CLI command or group for which you need an example.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
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. Use -p=secret if the first character of the password is '-'.
az login -u johndoe@contoso.com -p VerySecret
Log in with a service principal using client secret. Use -p=secret if the first character of the password is '-'.
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
Support access tenants without subscriptions. It's uncommon but useful to run tenant level commands, such as 'az ad'.
Log in using the Virtual Machine's identity.
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.
The credential representing a service principal.
The AAD tenant, must provide when using service principals.
Used with a service principal configured with Subject Name and Issuer Authentication in order to support automatic certificate rolls.
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.
User name, service principal, or managed service identity ID.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az logout
Log out to remove access to Azure subscriptions.
az logout [--username]
Optional Parameters
Account user, if missing, logout the current active account.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az rest
Invoke a custom request.
This command automatically authenticates using the logged-in credential: If Authorization header is not set, it attaches header Authorization: Bearer <token>
, where <token>
is retrieved from AAD. The target resource of the token is derived from --url if --url starts with an endpoint from az cloud show --query endpoints
. You may also use --resource for a custom resource.
If Content-Type header is not set and --body is a valid JSON string, Content-Type header will default to application/json.
az rest --uri
[--body]
[--headers]
[--method {delete, get, head, options, patch, post, put}]
[--output-file]
[--resource]
[--skip-authorization-header]
[--subscription]
[--uri-parameters]
Examples
Get Audit log through Microsoft Graph
az rest --method get --url https://graph.microsoft.com/beta/auditLogs/directoryAudits
Update a Azure Active Directory Graph User's display name
az rest --method patch --url "https://graph.microsoft.com/v1.0/users/johndoe@azuresdkteam.onmicrosoft.com" --body "{\"displayName\": \"jondoe2\"}"
Get a virtual machine
az rest --method get --uri /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}?api-version=2019-03-01
Create a public IP address from body.json file
az rest --method put --url https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}?api-version=2019-09-01 --body @body.json
List the top three resources (Bash)
az rest --method get --url https://management.azure.com/subscriptions/{subscriptionId}/resources?api-version=2019-07-01 --url-parameters \$top=3
Required Parameters
Request URL. If it doesn't start with a host, CLI assumes it as an Azure resource ID and prefixes it with the ARM endpoint of the current cloud shown by az cloud show --query endpoints.resourceManager
. Common token {subscriptionId} will be replaced with the current subscription ID specified by az account set
.
Optional Parameters
Request body. Use @{file} to load from a file. For quoting issues in different terminals, see https://github.com/Azure/azure-cli/blob/dev/doc/use_cli_effectively.md#quoting-issues.
Space-separated headers in KEY=VALUE format or JSON string. Use @{file} to load from a file.
HTTP request method.
Save response payload to a file.
Resource url for which CLI should acquire a token from AAD 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".
Do not auto-append Authorization header.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Query parameters in the URL. Space-separated queries in KEY=VALUE format or JSON string. Use @{file} to load from a file.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az self-test
Runs a self-test of the CLI.
az self-test [--subscription]
Optional Parameters
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az upgrade
Upgrade Azure CLI and extensions.
az upgrade [--all {false, true}]
[--subscription]
[--yes]
Optional Parameters
Enable updating extensions as well.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for checking release notes.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az version
Show the versions of Azure CLI modules and extensions in JSON format by default or format configured by --output.
az version [--subscription]
Optional Parameters
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.