【Azure 应用服务】App Server 部署后,Docker报错,找不到8080端口

简介: 【Azure 应用服务】App Server 部署后,Docker报错,找不到8080端口

问题描述

App Service for Container.  Docker Image 推送到ACR(向 Azure 容器注册表), 配置App Service并部署成功了。查看Docker日志(Log Stream页面)详情如下:

/home/LogFiles/2021_09_06_ll0sddwk000002_docker.log  (https://mytestappservice.scm.chinacloudsites.cn/api/vfs/LogFiles/2021_09_06_ll0sddwk000002_docker.log)
2021-09-06T03:28:44.786Z INFO  - Starting container for site
2021-09-06T03:28:44.787Z INFO  - docker run -d -p 8080:8080 --name mytestappservice_1_028b2421 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITE_SITE_NAME=mytestappservice -e WEBSITE_AUTH_ENABLED=False -e PORT=8080 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=mytestappservice.chinacloudsites.cn -e WEBSITE_INSTANCE_ID=35a46b817ece1fe1cb77c89f27ac5f991e8f7d4f86abe5add36a6d6afb3f9989 myacrtest01.azurecr.cn/myacrr01/backendapi:latest  
2021-09-06T03:28:44.788Z INFO  - Logging is not enabled for this container.
Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2021-09-06T03:28:49.314Z INFO  - Initiating warmup request to container mytestappservice_1_028b2421 for site mytestappservice
2021-09-06T03:29:20.005Z INFO  - Waiting for response to warmup request for container mytestappservice_1_028b2421. Elapsed time = 30.6914685 sec
2021-09-06T03:29:25.092Z ERROR - Container mytestappservice_1_028b2421 for site mytestappservice has exited, failing site start
2021-09-06T03:29:25.107Z ERROR - Container mytestappservice_1_028b2421 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2021-09-06T03:29:25.127Z INFO  - Stopping site mytestappservice because it failed during startup.

 

问题解决

对于自定义容器,App Service默认会尝试对端口 80 和 8080 进行自动端口检测, 而这里出现了HTTP ping 8080 failed,可以检测在Dockerfile中是否已经配置使用了8080端口。如果有,则从Dockerfile中修改,或者是通过App Service的Application Setting配置 WEBSITES_PORT参数,指定非8080的值,如WEBSITES_PORT = 8081。以解决问题。

 

 

更多有用有效的App Service for Container配置值,见:https://docs.microsoft.com/zh-cn/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#custom-containers

 

 

参考资料

将应用服务配置为从注册表部署映像: https://docs.microsoft.com/zh-cn/azure/app-service/tutorial-custom-container?pivots=container-linux#configure-app-service-to-deploy-the-image-from-the-registry

自定义容器配置参数名:https://docs.microsoft.com/zh-cn/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#custom-containers

 

相关文章
|
5天前
【Azure Logic App】使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub的解决之法
An exception occurred while retrieving properties for Event Hub: logicapp. Error Message: 'ClientSecretCredential authentication failed: AADSTS90002: Tenant 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Che
|
11天前
|
安全
【Azure App Service】App service无法使用的情况分析
App Service集成子网后,如果子网网段中的剩余IP地址非常少的情况下,会在App Service实例升级时( 先加入新实例,然后在移除老实例 )。新加入的实例不能被分配到正确的内网IP地址,无法成功的访问内网资源。 解决方法就是为App Service增加子网地址, 最少需要/26 子网网段地址。
|
20天前
|
C++
【Azure Logic App】使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub
【Azure Logic App】使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub
|
20天前
【Azure Logic App】在逻辑应用中开启或关闭一个工作流是否会对其它工作流产生影响呢?
【Azure Logic App】在逻辑应用中开启或关闭一个工作流是否会对其它工作流产生影响呢?
|
20天前
|
存储 SQL JSON
【Azure Logic App】微软云逻辑应用连接到数据库,执行存储过程并转换执行结果为JSON数据
【Azure Logic App】微软云逻辑应用连接到数据库,执行存储过程并转换执行结果为JSON数据
【Azure Logic App】微软云逻辑应用连接到数据库,执行存储过程并转换执行结果为JSON数据
|
20天前
|
安全 网络安全 Windows
【Azure App Service】遇见az命令访问HTTPS App Service 时遇见SSL证书问题,暂时跳过证书检查的办法
【Azure App Service】遇见az命令访问HTTPS App Service 时遇见SSL证书问题,暂时跳过证书检查的办法
【Azure App Service】遇见az命令访问HTTPS App Service 时遇见SSL证书问题,暂时跳过证书检查的办法
|
16天前
|
JSON 安全 网络协议
【Azure Policy】添加策略用于审计Azure 网络安全组(NSG)规则 -- 只能特定的IP地址允许3389/22端口访问
为了确保Azure虚拟机资源的安全管理,只有指定IP地址才能通过RDP/SSH远程访问。解决方案包括使用Azure Policy服务扫描所有网络安全组(NSG),检查入站规则中的3389和22端口,并验证源地址是否在允许的IP列表中。不符合条件的NSG规则将被标记为非合规。通过编写特定的Policy Rule并定义允许的IP地址参数,实现集中管控和合规性检查。
|
20天前
|
安全 前端开发 网络安全
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER
|
20天前
|
Java 应用服务中间件 nginx
【Azure Spring Apps】Spring App部署上云遇见 502 Bad Gateway nginx
【Azure Spring Apps】Spring App部署上云遇见 502 Bad Gateway nginx
|
20天前
|
存储 Linux 网络安全
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Linux/Linux Container)
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Linux/Linux Container)