Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
scrofungulus opened this issue Oct 1, 2020 · 22 comments
Open

Comments

@scrofungulus
Copy link

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.

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 1, 2020
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Oct 1, 2020
@bquantump
Copy link
Member

bquantump commented Oct 1, 2020

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

@yungezz yungezz removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Oct 3, 2020
@david-jarman
Copy link

david-jarman commented Oct 20, 2020

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.

@l3ender
Copy link

l3ender commented Nov 2, 2020

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.

@isaiahpettingill
Copy link

isaiahpettingill commented Aug 2, 2021

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.

@yonzhan yonzhan added this to the Backlog milestone Aug 2, 2021
@jiasli
Copy link
Member

jiasli commented Aug 3, 2021

As @bquantump pointed out in #15381 (comment), 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 (#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 #15381 (comment)

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.

@nrdev88
Copy link

nrdev88 commented Sep 23, 2021

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

@jiasli
Copy link
Member

jiasli commented Jan 25, 2022

Workaround

I have provided more detailed instruction on how to install with pip at #20476.

@paggarwalmsft
Copy link

Hi, is there any update on this issue?

@jiasli
Copy link
Member

jiasli commented Jan 25, 2022

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. ☺️

@ozbillwang
Copy link

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

Thanks.

@patricekrakow
Copy link

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

@sdg002
Copy link

sdg002 commented May 15, 2022

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?

@VOVELEE
Copy link

VOVELEE commented Sep 29, 2022

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

@ByteBrewerJB
Copy link

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

@ctahok
Copy link

ctahok commented Jan 13, 2023

I am waiting for one too

@ctahok
Copy link

ctahok commented Jan 14, 2023

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

The same is here

@andyxuan2010
Copy link

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

@golaat
Copy link

golaat commented May 25, 2023

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

@sdg002
Copy link

sdg002 commented Aug 22, 2023

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?

@l3ender
Copy link

l3ender commented Aug 22, 2023

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.

@jiasli
Copy link
Member

jiasli commented Aug 23, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests