az.cli
An interface to execute Azure CLI commands using Python
What it is and what it does
Az.cli is a thin Python wrapper around the Azure CLI that lets you call `az` commands from within Python scripts and get back structured results. Instead of shelling out and parsing text, you import the `az` function, call it with a command string (e.g., `az("group list")`), and receive a named tuple with an exit code, a parsed dictionary of the result, and any error logs. It relies on azure-cli being installed and configured on your system, using the same authentication and config stored in ~/.azure that the CLI itself uses.
The package is straightforward: it wraps the azure.cli.core interface and handles the plumbing of invoking commands and unpacking their output. It's useful for automation scripts, infrastructure-as-code tools, or applications that need to orchestrate Azure resources programmatically without building against the full Azure SDK.
Use it for:
- Automate Azure resource provisioning and management from Python scripts without calling subprocess directly.
- Build infrastructure-as-code tools that need to query or modify Azure resources and parse the results as dictionaries.
- Integrate Azure CLI commands into larger Python applications where you want structured output rather than text parsing.
- Write test or validation scripts that verify Azure resource state by running CLI commands and checking the returned data.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Executes Azure CLI commands from Python and returns structured results as a named tuple containing exit code, parsed output dictionary, and error logs.
No. While the package works and has low install friction, it is abandoned (last release 2021-03-14, last commit 2022-02-25). It will not receive updates for new Azure CLI versions, Python releases, or security issues. For new projects, use the official Azure SDK for Python instead; for existing code, consider migrating away.
Install
az-cli on PyPI
pip
pip install az-cliuv
uv add az-clipoetry
poetry add az-cliInstalling az.cli
Before you install
Low install friction with a single runtime dependency (azure-cli). However, the package is abandoned—last release was 2021-03-14 and last commit 2022-02-25—so it will not receive updates or security fixes for new Azure CLI versions or Python releases.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute it freely with minimal restrictions.
Quickstart
pip install az.cli
from az.cli import az
exit_code, result_dict, logs = az("group show -n test")
if exit_code == 0:
print(result_dict)
else:
print(logs)
Requires azure-cli to be installed and az login or service principal authentication to be configured in ~/.azure before use.
Verify before relying
- Whether the package works with Azure CLI versions released after 2022-02-25 or Python versions beyond 3.8.
- Current compatibility with modern azure-cli API changes or breaking changes in the underlying azure.cli.core module.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — azure-cli |
| Maintenance | abandoned — 1,979 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 585,025/month — #5,887 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: az.cli-0.5-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
azure-cli-coreProvides the core Python library and CLI…
permissive · top 5,000 on PyPI
azure-cliAzure CLI is a command-line tool for managing…
permissive · top 5,000 on PyPI
azdevazdev is a command-line tool that helps…
permissive · top 15,000 on PyPI
azure-cli-appserviceProvides Azure CLI commands for managing App…
permissive · top 15,000 on PyPI
azure-cli-acrProvides the Azure CLI 'acr' command module for…
permissive · top 15,000 on PyPI
azure-cli-sqlA command-line module for the Azure CLI that…
permissive · top 15,000 on PyPI
knackKnack is a Python framework for building…
permissive · top 5,000 on PyPI
azure-mgmt-resource-deploymentscriptsProvides a Python client library for managing…
permissive · top 5,000 on PyPI
azure-mgmt-domainregistrationManages Azure domain registrations…
permissive · top 5,000 on PyPI
azure-storage-blobClient library for uploading, downloading, and…
permissive · top 1,000 on PyPI