azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Unable to install Azure CLI on Windows without admin access to machine

Open scrofungulus opened this issue 5 years ago • 17 comments

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 avatar Oct 01 '20 18:10 scrofungulus

@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/

bquantump avatar Oct 01 '20 18:10 bquantump

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.

david-jarman avatar Oct 20 '20 21:10 david-jarman

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.

l3ender avatar Nov 02 '20 22:11 l3ender

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.

isaiahpettingill avatar Aug 02 '21 22:08 isaiahpettingill

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):

  1. Download Python from the official site https://www.python.org/downloads/windows/. Windows installer (64-bit) is preferred over Windows installer (32-bit).
  2. Install Python which doesn't require admin permission. It will be installed to
    C:\Users\<username>\AppData\Local\Programs\Python\Python39\python.exe
    
  3. (Optional) Upgrade pip:
    python -m pip install --upgrade pip
    
  4. Run pip to 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.

jiasli avatar Aug 03 '21 02:08 jiasli

Please fix the installer to not require admin rights. :-) This is a major difference compared to the "classic CLI".

nrdev88 avatar Sep 23 '21 08:09 nrdev88

Workaround

I have provided more detailed instruction on how to install with pip at https://github.com/Azure/azure-cli/issues/20476.

jiasli avatar Jan 25 '22 00:01 jiasli

Hi, is there any update on this issue?

paggarwalmsft avatar Jan 25 '22 04:01 paggarwalmsft

Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button?

image

That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread. ☺️

jiasli avatar Jan 25 '22 07:01 jiasli

@jiasli 's workaround to install az cli via pip is good enough.

Thanks.

ozbillwang avatar Mar 02 '22 21:03 ozbillwang

The installation of azure CLI az using pip did work for me on my employer-owned machine. Thanks to @jiasli.

patricekrakow avatar Mar 31 '22 13:03 patricekrakow

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?

sdg002 avatar May 15 '22 10:05 sdg002

It will be great feature and I think many people are anticipating it

VOVELEE avatar Sep 29 '22 06:09 VOVELEE

Im following this. My employer revoked all admin privileges for engineers.

ByteBrewerJB avatar Oct 20 '22 12:10 ByteBrewerJB

I am waiting for one too

ctahok avatar Jan 13 '23 16:01 ctahok

Im following this. My employer revoked all admin privileges for engineers.

The same is here

ctahok avatar Jan 14 '23 12:01 ctahok

The same is here. it would be very handy feature!!!

andyxuan2010 avatar Jan 20 '23 00:01 andyxuan2010

Will this ever be resolved? While is local admin access required?

golaat avatar May 25 '23 01:05 golaat

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

ozbillwang avatar Aug 22 '23 02:08 ozbillwang

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?

sdg002 avatar Aug 22 '23 21:08 sdg002

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 avatar Aug 22 '23 22:08 l3ender

@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.

jiasli avatar Aug 23 '23 06:08 jiasli