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

Support Azure CLI 64-bit on Windows #18766

Closed
pkoushik opened this issue Jul 8, 2021 · 7 comments · Fixed by #26640
Closed

Support Azure CLI 64-bit on Windows #18766

pkoushik opened this issue Jul 8, 2021 · 7 comments · Fixed by #26640

Comments

@pkoushik
Copy link

pkoushik commented Jul 8, 2021

Is your feature request related to a problem? Please describe.

Today we see that Azure CLI MSI installer only supports a 32 bit install of Azure CLI. Many other cloud providers and projects are moving away from supporting 32 bit in favor of 64 bit. In our case, we are building an extension which leverages an SDK that only supports 64 bit. For that reason, for some calls in the extension we run into issues because of 32 bit limitation in CLI

Describe the solution you'd like
We would like to see a natively supported 64 bit version of Azure CLI available to end users. This is available for AWS and GCP today, so it would be good to do the same in Azure.

Describe alternatives you've considered
We had previously reached out the Azure CLI team and we were given a temporary workaround is to have Azure CLI point to a 64 bit version of python. I will try this, and see if it resolves our issues, but I believe we can find a more permanent solution.

@ghost ghost added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Jul 8, 2021
@jiasli jiasli self-assigned this Jul 8, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Jul 8, 2021
@jiasli jiasli added this to the Backlog milestone Jul 8, 2021
@jiasli
Copy link
Member

jiasli commented Jul 23, 2021

Workaround

Azure CLI today doesn't release an 64-bit MSI installer and the workaround is to

  1. Download Python 64-bit from the official site https://www.python.org/downloads/windows/
  2. Run pip to install Azure CLI from PyPI https://pypi.org/project/azure-cli/:
    pip install azure-cli
    

Appliance team has tried the suggested manual workaround and it works. However, Appliance VMware customers will have to do the same manual workaround to deploy Appliance which could be an adoption barrier and will require documentation.

Additional information

GCP & AWS also support 64-bit MSI installers:

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 23, 2021

Since we are currently fully occupied with multiple high priority tasks we will add this feature request into our future roadmap.

@jiasli
Copy link
Member

jiasli commented Jul 27, 2021

Can 32-bit and 64-bit run on the same machine side by side?

If you follow the above workaround which uses pip to install, then yes. Please be aware that there can only be one python.exe on the PATH. If you have both 32-bit and 64-bit Python installed, their default full paths should be

  • 64-bit: C:\Users\<user>\AppData\Local\Programs\Python\Python39\python.exe
  • 32-bit: C:\Users\<user>\AppData\Local\Programs\Python\Python39-32\python.exe

Depending on the location where you install azure-cli, the commands differ.

Install to system python environment

You need to use the above full path to python.exe to invoke pip:

<full_path_to_python.exe> -m pip install azure-cli

Then use full path to invoke azure-cli:

<full_path_to_python.exe> -m azure.cli

Install to a virtual environment

Create a virtual environment:

<full_path_to_python.exe> -m venv <env_name>

Activate the virtual environment:

.\<env_name>\Scripts\Activate.ps1

Then you don't need to specify the python.exe to use and may simply run

pip install azure-cli
az ...

@jiasli
Copy link
Member

jiasli commented Jul 27, 2021

ℹ Note: If you have already install Azure CLI using MSI, az installed by MSI and az installed by pip will conflict on PATH. To solve it, either:

  • Use the full path to invoke Azure CLI:
    • pip: <full_path_to_python.exe> -m azure-cli
    • MSI: C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd
  • Remove one from PATH environment variable so that az is determined in a shell:
    • Open Start
    • Search for Edit the system environment variables
    • Click Environment Variables
    • Remove C:\Users\<user>\AppData\Local\Programs\Python\Python39\Scripts\ from PATH under User variables or C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin from PATH under System variables

@mkostersitz
Copy link

I had recently two of our top customers complain about the need to deploy Python 64 bit separately because their ITsec team has policies for the admin workstations to not allow standalone python installs (or any other programming language). If it is deployed with the Azure CLI this is acceptable though. This adds administrative overhead to the admin teams.

@xfz11
Copy link
Member

xfz11 commented Dec 9, 2022

Hi @jiasli, recently we meet a similar issue due to embedded 32bit python. Java team release passwordless experience with Azure CLI and attract many customers, but part of it doesn't work now because pyodbc is not compatible with 32bit python. It's very hard for users to build from source code for 32bit python which require many dependencies. Issue here: #24379

We know there's a workaround to install python and Azure CLI with pip, but users complain the experience is horrible. All links reference msi installation or package manager in Linux, normally people don't care about python and its versions.

We see that many other teams have the same requirement, is there any plan when it could be support?

@jiasli
Copy link
Member

jiasli commented May 24, 2023

cryptography 39 shows warning on 32-bit Python (#25690)

>>> import cryptography.hazmat.bindings.openssl.binding
<stdin>:1: UserWarning: You are using cryptography on a 32-bit Python on a 64-bit Windows Operating System.
Cryptography will be significantly faster if you switch to using a 64-bit Python.

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

Successfully merging a pull request may close this issue.

5 participants