Figured it out. Used console to figure out WinSCP.exe is located at C:\home\site\wwwroot\WinSCP.exe . Used session ExecutablePath to set when running in Azure .
SessionOptions sessionOptions = new SessionOptions()
{
Protocol = Protocol.Ftp,
HostName = GetEnvironmentVariable("WinSCP-Site", EnvironmentVariableTarget.Process),
UserName = GetEnvironmentVariable("WinSCP-Username", EnvironmentVariableTarget.Process),
Password = GetEnvironmentVariable("WinSCP-Password", EnvironmentVariableTarget.Process)
};
Session session;
using (session = new Session())
{
string runLoc = GetEnvironmentVariable("RunLocation", EnvironmentVariableTarget.Process);
if (runLoc == "Azure")
{
session.ExecutablePath = GetEnvironmentVariable("WinSCP-Executable", EnvironmentVariableTarget.Process);
}
session.Open(sessionOptions);
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Ascii;
TransferOperationResult transferResult = null;
transferResult = session.PutFiles(fn, GetEnvironmentVariable("TombstonePath", EnvironmentVariableTarget.Process), false, transferOptions);
transferResult.Check();
if (eMsg == "")
{
eMsg = $"Successfully ran function Tombstone at {DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss")}";
}
}