Hi,
I am hosting docker in windows container using Azure App Service.
Trying to FTP into an external remote server from docker.
Everything works fine in local pc, it does not work when deployed to Azure App Service.
System.TimeoutException: Timed out trying to connect! at FluentFTP.FtpSocketStream.Connect(String host, Int32 port, FtpIpVersion ipVersions) at FluentFTP.FtpClient.Connect(FtpSocketStream stream) at FluentFTP.FtpClient.Connect() at
Am using FluentFtp to do it as for now
FtpClient client = new FtpClient("waws-prod-sg1-067.ftp.azurewebsites.windows.net", 21, @"test", "test");
client.EncryptionMode = FtpEncryptionMode.Auto;
client.DataConnectionEncryption = true;
client.ValidateAnyCertificate = true;
client.SslProtocols = SslProtocols.Tls12;
client.DataConnectionType = FtpDataConnectionType.EPSV;
client.Connect();
await client.UploadBytesAsync(content, "test.xlsx");
Anyone can help or advise on this? Not much resource can be found online.
Thanks
@ronkit Thanks for your response on this. Based on the shared information i have understood that you are trying to connect to external FTP server from the windows docker container that is deployed on the app Service. Is that external FTP server is also part of Azure? If your external server is hosted on-prem make sure to check that there is no firewall configuration that is blocking the FTP.
From kudu console you can perform FTP, before performing FTP I would suggest checking whether you are able to connect to external server using TCP ping from the container.
You can also utilize curl which is installed in Kudu to test FTP connections to isolate if the issue is happening outside the context of your code.
Hi @VenkateshDodda-MSFT ,
You are right. Apparently there is firewall blocking on external FTP server.
It works after allowing the FTP to go through.
Thanks
@ronkit Thanks for your response. Glad to know that it helped.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.
Sign in to comment