Forum Discussion

sekharmpl's avatar
sekharmpl
Copper Contributor
Jul 13, 2021

How to read file content from sftp in azure function

I am trying to download file content from sftp and it works in windows10 local system but on azure portal not working.
File.OpenWrite throws error as Could not find file.

using (Stream tempFile = File.OpenWrite(tempFolder + fileName))
{
sftp.DownloadFile(fileFullName, tempFile);
}

Please suggest.

  • subhankars's avatar
    subhankars
    Copper Contributor
    Can you comfirm that the sftp path tempFolder + fileName is reachable from your azure resource?
    • sekharmpl's avatar
      sekharmpl
      Copper Contributor

      subhankars 

      Yes, I am able to reach the sftp folder.

      Problem with the compressed(.zip) file.

      I want read the content from compressed file in azure function. 

Resources