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

231 Views Asked by At

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.

I have a log file in my application inside the container. It says that: The remote name could not be resolved: 'XXXXXX.azurewebsites.net' <- This is the WCF Service

I have tried:

  • Set DNS 8.8.8.8 with application settings on azure [Nothing change]
  • Ping google.com [Fails]

Any ideas?

Thanks for the help!

2

There are 2 best solutions below

0
On BEST ANSWER

Thanks for help @Nancy Xiong, your answer is part of the solution, i discover that i need to apply a delay on my application inside the windows container. I don't know why, but when the application starts the container doesn't have network communication.

In this answer @Robbie Zhang says it is an ACI bug for Windows Server Core 2016 base container.

I guess Azure App Service For Containers has the same problem in Windows Server Core 2019 base containers.

0
On

To set public DNS server in Windows container app, you can run the following command:

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

enter image description here

For more details, you could read Private DNS for Native Windows Docker Container.