skillfed

az.cli

An interface to execute Azure CLI commands using Python

az-cli v0.5 585.0K downloads/30d#5,887 on PyPI22
Permissive license Abandoned released

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

uv

uv add az-cli

poetry

poetry add az-cli

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8

Tags

azure cli python wrapperrun az commands from pythonazure cli programmatic interfacepython azure management automationexecute azure cli in scripts
azure-integrationcli-wrapper

More Utilities packages