# Azure CLI

> Microsoft's cross-platform command-line interface for managing Azure resources with az group/subgroup/command syntax, JMESPath queries, and tab completion.

Stars: 4.7k · Language: Python · License: MIT · Categories: Dev Tools

- Repository: https://github.com/Azure/azure-cli
- Page: https://www.trmn.sh/tools/azure-cli

## Install

- Docker: `docker run -u $(id -u):$(id -g) -v ${HOME}:/home/az -e HOME=/home/az --rm -it mcr.microsoft.com/azure-cli:<version>`
- pip (edge build): `pip3 install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge --upgrade-strategy=eager`

## Overview

Azure CLI is Microsoft's command-line client for Azure. Commands follow the pattern `az [group] [subgroup] [command] {parameters}`, for example `az vm create` or `az storage`. Built-in help is available by passing `-h` to any group or command. It is a multi-platform tool and is also available in Azure Cloud Shell.

For output and scripting, it supports JSON, table, and tsv output formats, with a default you can change via `az configure`. The `--query` parameter takes JMESPath expressions to filter and reshape results, such as `az vm list --query "[?provisioningState=='Succeeded'].{ name: name, os: storageProfile.osDisk.osType }"`. It defines exit codes for scripts: 0 for success, 1 for generic errors, 2 for parser errors, and 3 for a missing ARM resource on `show` commands. Other documented features include tab completion for groups, commands, and some parameters (including resource group and VM names), generic resource commands via `az resource`, a raw REST call command via `az rest`, generic update arguments, async operation handling, and proxy support.

It also integrates with Visual Studio Code through the Azure CLI Tools extension, which provides IntelliSense, snippets, hover documentation, and run-in-terminal for `.azcli` files. Besides the standard installers, it ships as a Docker image (`mcr.microsoft.com/azure-cli`) and as edge builds from the `dev` branch (MSI, Homebrew formula, deb, rpm, and pip). Telemetry is on by default and can be disabled with `az config set core.collect_telemetry=no`. The typical users are developers, DevOps engineers, and administrators who provision and manage Azure resources interactively or in scripts.

### Installation

```bash
# via Docker
docker run -u $(id -u):$(id -g) -v ${HOME}:/home/az -e HOME=/home/az --rm -it mcr.microsoft.com/azure-cli:<version>
```

```bash
# via pip (edge build)
pip3 install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge --upgrade-strategy=eager
```

![Azure CLI Highlight Reel](https://media.trmn.sh/cached/8cedc4787e1758c4265ccda9926a5354f3d94f0cae4e10547163b967d8557ac6.gif)

![Azure CLI Tools in Action](https://media.trmn.sh/cached/53deaea004d518925c5dc76e26a2bf6f15df266b7f08732ce65a9016cf19fc8e.gif)

## Alternatives

- [harlequin](https://www.trmn.sh/tools/harlequin.md): Terminal-based SQL IDE with database adapter support for DuckDB, SQLite, PostgreSQL, MySQL and dozens of other databases (Python, 6.5k stars)
- [textual-astview](https://www.trmn.sh/tools/textual-astview.md): TUI tool for exploring Python Abstract Syntax Trees (AST) with interactive tree view and source highlighting (Python, 100 stars)
- [peplum](https://www.trmn.sh/tools/peplum.md): Terminal-based browser and search interface for Python Enhancement Proposals (PEPs) (Python, 27 stars)
- [GDB dashboard](https://www.trmn.sh/tools/gdb-dashboard.md): A standalone .gdbinit written in Python that shows a modular dashboard of program state in GDB each time the debugged program stops. (Python, 12.3k stars)
- [AWS CLI](https://www.trmn.sh/tools/aws-cli.md): Official command line interface for Amazon Web Services, with profile-based credentials, configurable output, and shell tab completion. (Python, 17.3k stars)

---

Canonical: https://www.trmn.sh/tools/azure-cli
