-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Is your feature request related to a problem? Please describe.
Currently on Windows, a cmd file is used as the entry point for Azure CLI: C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd
This causes several problems:
-
[Shell] Azure CLI receives corrupted arguments in PowerShell #15529. There was an attempt [Core] Add
az.ps1entry script for PowerShell #23514 to addaz.ps1for PowerShell, but that caused more issues and got reverted by [Core] Revert #23514: Rename entry scriptaz.ps1toazps.ps1#24015 -
Pressing Ctrl+C can't terminate
azcommands immediately. Instead,Terminate batch job (Y/N)?is shown:

-
az.cmdcan't be invoked by runningazin WSL, Cygwin or Git Bash. TheazBash entry script introduced by [Packaging] Add az script for Git Bash/Cygwin on Windows #13197 caused more issues: Carriage return\rbeing appended to the output #13573
Describe the solution you'd like
Replace entry script az.cmd with az.exe on Windows.
Additional context
-
The current
az.cmdimplementation requires Azure CLI to bundle a Python executableC:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe. This Python interpreter is considered not secure by some restrictions and organizations, because it allows using build-in modules such asctypesto execute arbitrary native code, bypassing enforcements such as Windows Defender Application Control (WDAC). -
We investigated using PyInstaller years ago in {Package} Use pyinstaller to package CLI #16115 but that PR didn't get merged.
-
There is a similar feature request Ship azure-cli as binary instead as Python module #23397 focusing on packaging the whole Azure CLI as a standalone binary on all platforms including Linux, while this feature request only focuses on
az.exeentry point on Windows and we may still have py files in the MSI package.