运行 Windows Azure 容器实例中的交互式 Powershell

Run interactive Powershell in Windows Azure Container Instance

我可以创建一个容器组:

az container create --os-type windows --resource-group dev --name win-sandbox --image mcr.microsoft.com/windows/servercore:1809

然后运行⬇️它立即退出,但我想要一个交互式的Powershell提示。

az container exec -g dev --name win-sandbox --exec-command "powershell.exe" 

这与从 docker run 中省略 -it 是一致的,但是 az container exec 没有这样的选项。

如何获得交互式 Powershell 提示?

How do I get an interactive Powershell prompt?

根据 Azure documentation ,目前 az container exec 以交互模式打开和执行不支持 windows 机器。

az container exec 从容器组的 运行 容器中执行命令。最常见的用例是打开交互式 bash shell.