Azure CLI in Docker not working
See original GitHub issue
az feedback
auto-generates most of the information requested below, as of CLI version 2.0.62
Describe the bug Whenever running a windows container on Docker in windows 2019 as the host, the “az” CLI command immediately returns rather than showing the banner and help information. The problem looks to be with the “python.exe” that it is calling in the CLI2 directory. That program seems to immediately return with no output when called from the commandline.
It seems to be related to the 12-2020 Cumulative Update (or some update since May 2020). When I uninstall the Cumulative update (machine reverts back to the may update), then it all starts working again…Python.exe returns an interactive session and the “az” commands work.
To Reproduce Install Docker on a Win2019 server (1809). Run a container that has the latest Azure CLI tools on it 2.16.0. Apply 12-2020 Cumulative update. Interact with the container via “docker exec” and try to run “az”…the behavior is that it immediately returns without displaying anything.
Expected behavior Display the commandline options when “az” is run.
Environment summary Azure tools was installed into docker image using the following commands in the Dockerfile:
RUN choco install az.powershell -y --version 4.4.0 RUN Invoke-WebRequest -Uri https://azurecliprod.blob.core.windows.net/msi/azure-cli-2.9.1.msi -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList ‘/I AzureCLI.msi /quiet’; del AzureCLI.msi
Additional context Running on Docker 19.03 Windows Server 2019 (build 17763)
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
I got the same problem and finally came to conclusion that it could be related to this the Windows container version compatibility.
I was able to fix this by updating my container host with the latest patches and in conjunction with latest Windows Server core images.
I hope it can help.
It seems to be working with April 2021 CU on Windows 2019.