'No logs for Windows Nano Server image on Azure Container Instances

When I create new container instance on Azure with ubuntu:latest for an image, with default properties and starting command: [ "/bin/bash", "-c", "echo hello" ], everything works great and I get output hello in the logs. I can also print it using az container logs command.

When I attempt to do the same with Windows Nano Server image (pulling mcr.microsoft.com/windows/nanoserver:sac2016) and starting command: [ "cmd", "/c", "echo hello" ], the image runs succesfully, but I get no logs, nothing in the Azure Portal GUI, nothing in az container logs output.

Is there something wrong with the default configuration? Or is stdout simply not supported for Windows images? This version of nanorserver is explicitly listed in Microsoft documentation as currently supported with Container Instances.

When I run docker locally, it behaves as expected:

> docker run mcr.microsoft.com/windows/nanoserver:sac2016 cmd /c echo hello >log.txt
> type log.txt
hello


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source