FTP/FTPS not working in Docker window container in Azure App Service

ronkit 36 Reputation points
2022-09-01T03:09:23.617+00:00

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

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,839 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,756 questions
0 comments No comments
{count} votes

Accepted answer
  1. VenkateshDodda-MSFT 20,696 Reputation points Microsoft Employee
    2022-09-01T08:54:52.797+00:00

    @ronkit Thank you for reaching out to Microsoft Q&A. Can you try connecting to your container using any other FTP clients like (FileZilla, WinSCP, etc) and also, I hope you are using app level credentials while connecting to the webapp container.

    Make sure FTP is enabled on your app service. If it is disabled state, I would suggest you enable it by following these documentation steps

    Feel Free to reach back to me if you have any further questions on this.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.