Use FluentFTP to connect external FTP server from AKS cluster

Anh Hoàng Tuấn 1 Reputation point
2022-02-25T04:54:49.387+00:00

Hello,
I'm using FluentFTP to connect external FTP server.
When i run debug from my localhost. it's working fine.
But when i deploy to AKS.
FluentFTP throw exception timeout to connect

177727-untitled.png

Here my code:

                var useFtp = _configuration.GetValue<bool>("UseFtp");  
                var ftpHost = _configuration.GetValue<string>("Ftp:Host");  
                _logger.LogInformation(ftpHost + "Host");  
                var ftpPort = _configuration.GetValue<Int32>("Ftp:Port");  
                _logger.LogInformation(ftpPort + "Port");  
                var ftpUser = _configuration.GetValue<string>("Ftp:User");  
                _logger.LogInformation(ftpUser + "User");  
                var ftpPassword = _configuration.GetValue<string>("Ftp:Password");  
                _logger.LogInformation(ftpPassword + "Password");  
using (var client = new FtpClient(ftpHost, ftpPort, ftpUser, ftpPassword))  
                    {  
                        client.EncryptionMode = FtpEncryptionMode.Explicit;  
                        client.DataConnectionType = FtpDataConnectionType.PASV;  
                        client.Connect();  
}  

How can i do to fix this issue?

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,448 questions
{count} votes

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.