Forum Discussion

Kalyani1714's avatar
Kalyani1714
Copper Contributor
Jun 28, 2023

Azure Function connection error with SFTP Server

Hello, I have Timmer trigger function, which runs every minute and reading the files from SFTP servers (reading files for multiple servers around 20 servers) and for each instance, new connection create for communicate with server and close after reading the files. I am using WinSCP dll. and function app running on Consumption plan

 

Issue: Getting an error "WinSCP.SessionRemoteException: Server unexpectedly closed network connection." after few hours and it will remain until I restart the function app. 

 

 

 

 

1 Reply

  • habeebyakubu's avatar
    habeebyakubu
    Copper Contributor
    Azure functions are not intended for long running background tasks. Look for a way to reduce the opened session time from within the code. Perhaps, premium plan could help, but I would also not advice.

Resources