How to Install azure-identity in Python
Microsoft Azure Identity Library for Python
pip install azure-identity
What is azure-identity?
Microsoft Azure Identity Library for Python
Azure Identity client library for Python
The Azure Identity library provides Microsoft Entra ID token-based authentication support across the Azure SDK. It provides a set of [][tokencredref]/[][supportstokeninforef] implementations, which can be used to construct Azure SDK clients that support Microsoft Entra token authentication.
Source code | Package (PyPI) | Package (Conda) | [API reference documentation][refdocs] | Microsoft Entra ID documentation
Quick Start
Minimal example to get started with azure-identity:
import azure.identity
print(azure.identity.__version__)
Installation
pip (standard)
pip install azure-identity
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install azure-identity
pip3
pip3 install azure-identity
conda
conda install -c conda-forge azure-identity
Poetry
poetry add azure-identity
Dependencies
Installing azure-identity will also install these packages:
Verify the Installation
After installing, confirm the package is available:
python -c "import azure.identity; print(azure.identity.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing azure-identity with pip.
ModuleNotFoundError: No module named 'azure.identity'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install azure-identity. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'azure.identity' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install azure-identity to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'azure.identity'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show azure-identity and upgrade with pip install --upgrade azure-identity.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install azure-identity. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user azure-identity
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org azure-identity
Recent Releases
| Version | Released |
|---|---|
1.25.3 latest |
2026-03-13 |
1.26.0b2 |
2026-02-12 |
1.25.2 |
2026-02-11 |
1.26.0b1 |
2025-11-07 |
1.25.1 |
2025-10-06 |
Manage azure-identity
Upgrade to latest version
pip install --upgrade azure-identity
Install a specific version
pip install azure-identity==1.25.3
Uninstall
pip uninstall azure-identity
Check what is installed
pip show azure-identity