How to download zip file content from sftp

Soma Sekhar Turpinti 21 Reputation points

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

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,476 questions
{count} votes

Accepted answer
  1. Pramod Valavala 20,601 Reputation points Microsoft Employee

    @Soma Sekhar Turpinti The function app root is usually not writable when running from a package (which is common for most deployment paths). That is why your code works locally.

    When running on Azure, use the Path.GetTempPath method to get the temporary path.

    If you are running on a Linux plan, you could mount file shares.

    0 comments No comments

0 additional answers

Sort by: Most helpful