Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

Support Azure CLI 64-bit on Windows #18766

Closed pkoushik closed 1 year ago

pkoushik commented 3 years ago

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.

jiasli commented 3 years ago

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 commented 3 years ago

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

jiasli commented 3 years ago

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

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 commented 3 years ago

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

mkostersitz commented 2 years ago

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 commented 1 year ago

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: https://github.com/Azure/azure-cli/issues/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 commented 1 year ago

cryptography 39 shows warning on 32-bit Python (https://github.com/Azure/azure-cli/pull/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.