繁体   English   中英

Azure Web 容器应用程序 - 容器无法连接到外部 WCF 服务

[英]Azure Web App For Containers - Container cannot connect to outside WCF Service

I have a windows container as Azure Web App, it has a connection to a WCF Service outside the container, when i test the functionality of the container locally it works, but not in Azure.

我在容器内的应用程序中有一个日志文件。 它说:无法解析远程名称:'XXXXXX.azurewebsites.net' <- 这是 WCF 服务

我努力了:

  • 使用 azure 上的应用程序设置设置 DNS 8.8.8.8 [无变化]
  • Ping google.com [失败]

有任何想法吗?

谢谢您的帮助!

要在 Windows 容器应用程序中设置公共 DNS 服务器,可以运行以下命令:

$nic = Get-NetAdapter
Set-DnsClientServerAddress -InterfaceIndex $nic.IfIndex -ServerAddresses ('8.8.8.8')

在此处输入图像描述

有关更多详细信息,您可以阅读Private DNS for Native Windows Docker Container

感谢@Nancy Xiong的帮助,您的回答是解决方案的一部分,我发现我需要在 windows 容器内的应用程序上应用延迟。 我不知道为什么,但是当应用程序启动时容器没有网络通信。

在这个答案中, @Robbie Zhang说这是 Windows Server Core 2016 基本容器的 ACI 错误。

我猜 Azure App Service For Containers 在 Windows Server Core 2019 基础容器中存在同样的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM