azure-cli
azure-cli copied to clipboard
Unable to install Azure CLI on Windows without admin access to machine
Is your feature request related to a problem? Please describe. As the title states, there is not currently a way (or I have not been able to find one) to install the Azure CLI without having admin privileges to the machine. This is fine for personal machines, but employer owned machines are typically highly locked down.
Describe the solution you'd like A sane way to install the cli without admin privileges.
@scrofungulus Thank you for your request.
A work around is to pip install the CLI if you have python already installed: pip install azure-cli
It is recommend you do this through a virtual environment (so it doesn't apply system wide) although not required: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
Was hoping this would unblock me but I ran into an issue with the pip install:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for cryptography
And ofc you need Admin Privileges to install "Microsoft C++ Build Tools"
edit: suggest adding an option to the MSI / installation wizard to install for only the current user, similar to the python installer.
Is there any standalone executable that can be used instead of the admin install? We are not able to use the CLI in our organization. We have Windows but Python is not installed.
Is there any standalone executable that can be used instead of the admin install?
Python does not typically compile to a native executable. The Azure CLI requires a python interpreter.
As @bquantump pointed out in https://github.com/Azure/azure-cli/issues/15381#issuecomment-702328246, currently installing via pip is the only option to install Azure CLI without admin permission. You may also use this approach to run Azure CLI as 64-bit (https://github.com/Azure/azure-cli/issues/18766):
- Download Python from the official site https://www.python.org/downloads/windows/. Windows installer (64-bit) is preferred over Windows installer (32-bit).
- Install Python which doesn't require admin permission. It will be installed to
C:\Users\<username>\AppData\Local\Programs\Python\Python39\python.exe - (Optional) Upgrade
pip:python -m pip install --upgrade pip - Run
pipto install Azure CLI from PyPI https://pypi.org/project/azure-cli/:pip install azure-cli
@david-jarman, for error https://github.com/Azure/azure-cli/issues/15381#issuecomment-713155243
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for cryptography
This is because you are using an old version of pip which can't resolve the pre-compiled library correctly. You may follow the above step 3 to upgrade pip first and try again.
Please fix the installer to not require admin rights. :-) This is a major difference compared to the "classic CLI".
Workaround
I have provided more detailed instruction on how to install with pip at https://github.com/Azure/azure-cli/issues/20476.
Hi, is there any update on this issue?
Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button?

That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread. ☺️
@jiasli 's workaround to install az cli via pip is good enough.
Thanks.
The installation of azure CLI az using pip did work for me on my employer-owned machine. Thanks to @jiasli.
I have been facing this problem at my new employer. I needed IT intervention to get AZ CLI to get installed.
But, the problem does not stop here. When I use the command az upgrade , it fails once again due to me not having Admin rights on the local workstation.
May I ask what was Microsoft's rationale in chosing such an installation model?
It will be great feature and I think many people are anticipating it
Im following this. My employer revoked all admin privileges for engineers.
I am waiting for one too
Im following this. My employer revoked all admin privileges for engineers.
The same is here
The same is here. it would be very handy feature!!!
Will this ever be resolved? While is local admin access required?
will this be helpful?
https://stackoverflow.com/questions/75377993/how-to-install-az-cli-on-a-locked-up-windows-10-without-admin-rights-behind-a-co/75378210#75378210
will this be helpful?
https://stackoverflow.com/questions/75377993/how-to-install-az-cli-on-a-locked-up-windows-10-without-admin-rights-behind-a-co/75378210#75378210
Interesting approach. I am divided. Are these many extra steps really needed in the first place ? Shouldn't MS be fixing the obvious problem? Or is MS listening at all?
will this be helpful?
https://stackoverflow.com/questions/75377993/how-to-install-az-cli-on-a-locked-up-windows-10-without-admin-rights-behind-a-co/75378210#75378210
We're using this approach as a workaround, but have found it has some issues.
The largest one is that the pip version of az-cli can cause conflicts if you have installed other Azure-related python dependencies. We run into this when using Ansible and the Azure collection (which under the hood uses specific Azure python dependencies). To get around this, we install az-cli in its own virtual environment. This has issues of its own, but it at least provides a path forward.
Secondly, we found the release cycle for az-cli differs than the full tool, so bugs aren't always resolved at the same time.
@l3ender,
To get around this, we install az-cli in its own virtual environment.
Installing Azure CLI in a virtual environment is the right path. Detailed instructions for installing with pip is provided in https://github.com/Azure/azure-cli/issues/20476.
we found the release cycle for az-cli differs than the full tool, so bugs aren't always resolved at the same time.
az-cli is not the official Azure CLI. Azure CLI's package on PyPI is azure-cli.