我有一个 Windows 容器作为 Azure Web 应用程序,它连接到容器外的 WCF 服务,当我在本地测试容器的功能时,它可以工作,但不能在 Azure 中工作。
我的应用程序在容器内有一个日志文件。它说: 无法解析远程名称:'XXXXXX.azurewebsites.net' <- 这是 WCF 服务
我试过了:
有什么想法吗?
感谢您的帮助!
答案 0 :(得分:1)
要在 Windows 容器应用中设置公共 DNS 服务器,您可以运行以下命令:
$nic = Get-NetAdapter
Set-DnsClientServerAddress -InterfaceIndex $nic.IfIndex -ServerAddresses ('8.8.8.8')
有关详细信息,您可以阅读Private DNS for Native Windows Docker Container。