Describe the bug
All az commands fail to run when in the following configuration:
- Azure Linux 3
azure-cli installed via tdnf
- A venv is activated
- The venv has some
azure packages installed, but not azure.cli
Related command
az --version
Errors
% az --version
azure-cli 2.75.0
core 2.75.0
telemetry 1.1.0
Extensions:
azure-devops 1.0.2
connectedk8s 1.10.7
k8s-extension 1.6.5
Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0
Python location '/usr/bin/python3.12'
Config directory '/home/acsa/.azure'
Extensions directory '/home/acsa/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.12/site-packages/azure-cli-extensions'
Python (Linux) 3.12.9 (main, Jun 12 2025, 19:38:44) [GCC 13.2.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
% . .venv/bin/activate
(redacted) % /usr/bin/az --version
/workspace/redacted/redacted/.venv/lib/python3.12/site-packages/azure/__init__.py:5: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
/workspace/redacted/redacted/.venv/bin/python3.12: No module named azure.cli
(redacted) % ls .venv/lib64/python3.12/site-packages/azure | wc -l
11
(redacted) % ls .venv/lib64/python3.12/site-packages/azure/cli
ls: cannot access '.venv/lib64/python3.12/site-packages/azure/cli': No such file or directory
(redacted) % deactivate
% az --version
azure-cli 2.75.0
core 2.75.0
telemetry 1.1.0
Extensions:
azure-devops 1.0.2
connectedk8s 1.10.7
k8s-extension 1.6.5
Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0
Python location '/usr/bin/python3.12'
Config directory '/home/acsa/.azure'
Extensions directory '/home/acsa/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.12/site-packages/azure-cli-extensions'
Python (Linux) 3.12.9 (main, Jun 12 2025, 19:38:44) [GCC 13.2.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Issue script & Debug output
az --debug --version
/workspace/redacted/redacted/.venv/lib/python3.12/site-packages/azure/__init__.py:5: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
/workspace/redacted/redacted/.venv/bin/python3.12: No module named azure.cli
Expected behavior
I would expect the same behavior from az with the venv both activated and not.
Environment Summary
% az --version
azure-cli 2.75.0
core 2.75.0
telemetry 1.1.0
Extensions:
azure-devops 1.0.2
connectedk8s 1.10.7
k8s-extension 1.6.5
Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0
Python location '/usr/bin/python3.12'
Config directory '/home/acsa/.azure'
Extensions directory '/home/acsa/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.12/site-packages/azure-cli-extensions'
Python (Linux) 3.12.9 (main, Jun 12 2025, 19:38:44) [GCC 13.2.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response
Describe the bug
All
azcommands fail to run when in the following configuration:azure-cliinstalled viatdnfazurepackages installed, but notazure.cliRelated command
az --versionErrors
Issue script & Debug output
Expected behavior
I would expect the same behavior from
azwith the venv both activated and not.Environment Summary
Additional context
No response