Skip to content

Incorrect az.bat when installed through pip on Windows #7372

Description

@gopitk

Describe the bug
The az.bat (https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/az.bat) that you get when you "pip install azure-cli" is incorrect,. The correct one is: https://github.com/Azure/azure-cli/blob/dev/build_scripts/windows/scripts/az.cmd

To Reproduce
Install Azure CLI on Windows through "pip install azure-cli"

Expected behavior
Remove az.bat and include the az.cmd in the Scripts directory when installing through pip.

Environment summary
Windows. My test was on a Server 2016 on a command prompt.

Additional context
The impact of this issue is that the AZ CLI is not running in the correct Python.exe where the azure cli libraries are installed. Our servers have multiple Python instances and the the one activated / default Python environment may not be the one where we pip installed the azure-cli but we still want to run the "az" command to manage Azure resource from the command line . Our workaround is to manually remove az.bat and copy the az.cmd in the "Scripts" directory. That seems to work fine for us though I want to understand if there is something that may still break. Also looks like the Azure CLI MSI installer correctly included the az.cmd.

Activity

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions