【Container App】部署Contianer App 遇见 Failed to deploy new revision: The Ingress's TargetPort or ExposedPort must be specified for TCP apps.
问题描述
在部署Contianer App时候,遇见Failed to deploy new revision: The Ingress's TargetPort or ExposedPort must be specified for TCP apps.
回到Container App的门户,然后修改操作都会触发报错。均提示 The Ingress's TargetPort or ExposedPort must be specified for TCP apps. 信息。
这是什么情况呢?
问题解答
根据提示信息 :The Ingress's TargetPort or ExposedPort must be specified for TCP apps.
当 Container App 的 Ingress 设置为TCP时,必须同时指定 TargetPort 和 ExposedPort 。
- Target port (与容器中应用通信的端口) : This is the port your container is listening on that will receive traffic. Set this value to the port number that your container uses. For HTTP ingress, your application ingress endpoint will always be exposed on port 443. For TCP ingress, configure the exposed port to customize your application ingress endpoint.
- Exposed port (暴露给外部用户访问的端口): This is the port that other applications will use to connect to your TCP application.
因为使用HTTP Ingress Type的时候,exposed不需要配置,因为它只会使用80/443端口,但是TCP ingress时,需要指定对外部用户暴露的端口。
而在部署 Container App的新版本时候遇见错误的原因就是在Ingress页面从HTTP 修改为 TCP时, 这个页面中对 Exposed Port 字段没有必填验证,从而导致后后续无法对Container App做任何更新操作。
当为TCP ingress type指定了一个端口后 (可以指定与 target port相同的值),问题得到解决。
参考资料
Target port missing error while port is present : https://github.com/hashicorp/terraform-provider-azurerm/issues/26902#issuecomment-2264426370
当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· NetPad:一个.NET开源、跨平台的C#编辑器
· PowerShell开发游戏 · 打蜜蜂
2023-12-27 [App Service for Windows]通过 KUDU 查看 Tomcat 配置信息
2022-12-27 【Azure 云服务】为Azure云服务配置上自签名的SSL证书步骤