运行多容器应用程序时,用于容器的Azure Web App是否支持ssh访问?

时间:2019-12-18 15:28:47

标签: azure docker ssh docker-compose azure-web-app-service

我正在运行带有自定义容器映像的Azure Web应用程序(容器)。我已经按照步骤将ssh启用到容器映像中,并且当我仅运行单个容器时,它的效果很好。但是,当我将该应用程序作为一个多容器应用程序(带有docker-compose文件)运行时,具有多个容器映像,则出现以下错误。对于其他上下文,这是一个小型的python Web应用程序,它使用nginx和redis,因此需要多个容器。我的自定义映像中只有一个启用了ssh并正在运行并公开端口2222。

这甚至可能吗?如果不是,那么我不确定如果出于支持目的无法访问容器的话,运行Web应用程序多容器是多么可行。

az webapp remote-connection create -g GROUPNAME -n APPNAME -p 2222 --verbose                 
Configured default 'GROUPNAME' for arg resource_group_name
remote-connection is deprecated and moving to cli-core, use `webapp create-remote-connection`
Port 2222 is open
Creating a socket on port: 2222
Setting socket options
Binding to socket on local address and port
Finished initialization
Status response message: FAILURE:2222:Unable to connect to WebApp
WARNING - Remote debugging may not be setup properly. Reponse content: FAILURE:2222:Unable to connect to WebApp
SSH is available { username: root, password: Docker! }
Start your favorite client and connect to port 2222

我也尝试了create-remote-connection命令,但结果相似。

az webapp create-remote-connection -n APPNAME -g GROUPNAME --verbose &

我收到的错误是:

Auto-selecting port: 52661
Finished initialization
Status response message: FAILURE:2222:Unable to connect to WebApp
WARNING - Remote debugging may not be setup properly. Reponse content: FAILURE:2222:Unable to connect to WebApp
Connection is not ready yet, please wait
.
Status response message: FAILURE:2222:Unable to connect to WebApp
WARNING - Remote debugging may not be setup properly. Reponse content: FAILURE:2222:Unable to connect to WebApp