Azure CLI 2.0: Command reference - az

Commands

az account Manage subscriptions.
az acr Manage Azure Container Registries.
az acs Manage Azure Container Services.
az ad Synchronize on-premises directories and manage Azure Active Directory resources.
az appservice Manage your App Service plans.
az batch Manage Azure Batch.
az billing Manage Azure Billing.
az cdn Manage Azure Content Delivery Networks (CDN).
az cloud Manage the registered Azure clouds.
az cognitiveservices Manage Cognitive Services accounts in Azure Resource Manager.
az component Manage and update Azure CLI 2.0 components.
az configure Configure Azure CLI 2.0 or view your configuration. The command is interactive, so just type az configure and respond to the prompts.
az consumption Manage Azure Consumption.
az cosmosdb Manage Azure Cosmos DB database accounts.
az disk Manage Azure Managed Disks.
az dla Commands to manage Data Lake Analytics accounts, jobs, and catalogs.
az dls Commands to manage Data Lake Store accounts, and filesystems.
az feature Manage resource provider features, such as previews.
az feedback Loving or hating the CLI? Let us know!
az find Find Azure CLI commands based on a given query.
az functionapp Manage your function app.
az group Manage resource groups and template deployments.
az image Manage custom Virtual Machine Images.
az interactive Start the interactive experience.
az iot Connect, monitor, and control millions of IoT assets.
az keyvault Safeguard and maintain control of keys, secrets, and certificates.
az lab Commands to manage DevTest Labs.
az lock Manage Azure locks.
az login Log in to access Azure subscriptions.
az logout Log out to remove access to Azure subscriptions.
az managedapp Manage template solutions provided and maintained by the ISV using managedapp and managedapp definitions.
az monitor Commands to manage Azure Monitor service.
az mysql Commands to manage Azure Database for MySQL servers.
az network Manages Azure Network resources.
az policy Manage resource policies.
az postgres Commands to manage Azure Database for PostgreSQL servers.
az provider Manage resource providers.
az redis Access to a secure, dedicated cache for your Azure applications.
az resource Manage Azure resources.
az role Use role assignments to manage access to your Azure resources.
az sf Manage and administer a Service Fabric cluster.
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 storage Durable, highly available, and massively scalable cloud storage.
az tag Manage resource tags.
az taskhelp Provides long-form help content by topic.
az vm Provision Linux or Windows virtual machines in seconds.
az vmss Create highly available, auto-scalable Linux or Windows virtual machines.
az webapp Manage web apps.

az configure

Configure Azure CLI 2.0 or view your configuration. The command is interactive, so just type az configure and respond to the prompts.

az configure [--defaults]

Optional Parameters

--defaults -d

Space separated 'name=value' pairs for common arguments defaults, e.g. '--defaults group=myRG web=myweb vm=myvm'. Use '' to clear the defaults, e.g. --defaults vm='' web=''.

az feedback

Loving or hating the CLI? Let us know!

az feedback

az find

Find Azure CLI commands based on a given query.

az find --search-query
[--reindex]

Examples

Search for things containing 'vm' or 'secret'

az find -q vm secret

Required Parameters

--search-query -q

Query text to find.

Optional Parameters

--reindex

Clear the current index and reindex the command modules.

az interactive

An interactive environment that makes it easier to learn and use Azure CLI commands. 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}]

Optional Parameters

--style -s

The colors of the shell.

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

az login

Log in to access Azure subscriptions.

az login [--allow-no-subscriptions]
[--password]
[--service-principal]
[--tenant]
[--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

Optional Parameters

--allow-no-subscriptions

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

--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.

--username -u

Organization id or service principal.

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.