On my Mac the az cli needs Python 3.10, and I didn’t want to pin Homebrew’s Python to that version, so instead I use uv to manage multiple Python versions.

# install special python version for uv 
uv python install 3.10
# create dir
mkdir /tmp/az
# create virtual environment dir .venv
uv venv --python 3.10

Then you can install the azure-cli package:

uv pip install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge
uv pip install rpds-py

When you want to use it, just source the environment; I’ll look for a better approach later.

source .venv/bin/activate

[1] https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-macos?view=azure-cli-latest