Re: Azure App Service - connection attempt failed
If the code works in other environments, I'm quite sure that no change in the code will help to make it working on Azure. This looks like a firewall issue.
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
var sessionOptions = new SessionOptions()
{
Protocol = Protocol.Ftp,
HostName = _hostName,
UserName = _userName,
Password = _password,
TimeoutInMilliseconds = 60000,
};
_session = new Session();
_session.DisableVersionCheck = true;
_session.DebugLogLevel = 0;
_session.ExecutablePath =
Path.Combine(AppDomain.CurrentDomain.BaseDirectory + "winscp.exe");
_session.Open(sessionOptions)