question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
MathieuHamelcommented, Feb 4, 2021

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.

0reactions
mkoziel2000commented, Apr 19, 2021

It seems to be working with April 2021 CU on Windows 2019.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to run Azure CLI in a Docker Container - Microsoft Learn
Start the Docker container with Azure CLI pre-installed. Note · Run the Docker container with a specific version of the Azure CLI. Available ......
Read more >
Azure CLI cannot conect to the Docker Daemon - Stack Overflow
run az acr login first with the --expose-token parameter. This option exposes an access token instead of logging in through the Docker CLI....
Read more >
Running Azure CLI in Docker container - Jani Karhunen
The first thing we need to do is the login, so run az login . This will show an URL and code we...
Read more >
Azure CLI by Microsoft | Docker Hub
Azure CLI 2.0 is Azure's new command-line experience for managing Azure resources. You can use it in your browser with Azure Cloud Shell,...
Read more >
Using Azure CLI Authentication within Local Containers - Endjin
How to fix Azure CLI Credentials in Docker ... A few workarounds have been suggested elsewhere, but I've not seen this method mentioned...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found