@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.
I have created folder in azure function application root like TempFolder and I want download and store the zip file from sftp temp folder and extract.
But when I try to use File.OpenWrite(tempFolder + fileName)) it throws error on portal as Could not find file.