I am writing an Azure function that uses WinSCP library to download files using SFTP and upload the files on blob storage. This library doesn't allow to get files as a Stream
. Only option is to download them locally. My code also uses a private key file. So i have 2 questions.
sessionOptions.SshPrivateKeyPath = Path.GetFullPath("privateKey2.ppk");
is working locally. I have added this file in solution with option "copy to output" and it works. But will it work when Azure function is deployed?
While getting the files I need to specify local path where the files will be downloaded.
var transferResult = session.GetFiles( file.FullName, Path.GetTempPath() + @"SomeFolder\" + file.Name, false, transferOptions);
The second parameter is the local path.
What should I use in place of
Path.GetTempPath()
that will work when Azure function is deployed?