Differences

This shows you the differences between the selected revisions of the page.

2019-03-12 2019-08-20
fit to page width (martin) wording (martin)
Line 1: Line 1:
====== SFTP/FTPS file transfers in Microsoft Azure Function ====== ====== SFTP/FTPS file transfers in Microsoft Azure Function ======
-To use [[library|WinSCP .NET assembly]] to implement an SFTP/FTP functionality in [[https://docs.microsoft.com/en-us/azure/azure-functions/|Microsoft Azure Function]], just add [[library_install#nuget|WinSCP NuGet package]] to your .NET function project and then use any [[library_examples|standard WinSCP code]].+To use [[library|WinSCP .NET assembly]] to implement an SFTP/FTP functionality in [[https://docs.microsoft.com/en-us/azure/azure-functions/|Microsoft Azure Function]], just add [[library_install#nuget|WinSCP NuGet package]] to your Azure Functions project in Visual Studio and then use any [[library_examples|standard WinSCP code]].
-The only problem you will face, is that for some reason, when publishing the project to an Azure storage, ''winscp.exe'' dependency is stored to the root folder of the function, instead of the ''bin'' subfolder along with other binaries (particularly the ''WinSCPnet.dll'').+The only problem you will face is, that for some reason, when publishing the project to an Azure storage, ''winscp.exe'' dependency is stored to the root folder of the function, instead of the ''bin'' subfolder along with other binaries (particularly the ''WinSCPnet.dll'').
-So overcome that, you need to use [[library_session#executablepath|''Session.ExecutablePath'']] to point to the actual location of ''winscp.exe''. You can use ''ExecutionContext.FunctionAppDirectory'' to refer to the root folder of the function. To get an instance of the [[https://docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-how-to#executioncontext|''ExecutionContext'']], add new parameter to the signature of [[https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-class-library#methods-recognized-as-functions|your entry method]] (usually ''Run''):+To overcome that, you need to use [[library_session#executablepath|''Session.ExecutablePath'']] to point to the actual location of ''winscp.exe''. You can use ''ExecutionContext.FunctionAppDirectory'' to refer to the root folder of the function. To get an instance of the [[https://docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-how-to#executioncontext|''ExecutionContext'']], add new parameter to the signature of [[https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-class-library#methods-recognized-as-functions|your entry method]] (usually ''Run''):
<code csharp> <code csharp>

Last modified: by martin