- Login to an FTP Server and get existing files
- Save the files to a Blob Container
- Remove the copied files from the FTP Server
- Log activity to Log Analytics. You can get alerted on FTP failures and create file transfer dashboards.
Query to alert on FTP failures for the last hour:
FtpTransfer_CL
| where Result_s != "Success" and TimeGenerated > ago(1h)
Query for a dashboard with number of files and total GB transferred:
FtpTransfer_CL
| where Result_s == "Success" and TimeGenerated > ago(24h)
| summarize Files = count(), GB = sum(Size_d)/1000000000
- A Log Analytics Workspace. Not a hard requirement as code graciously keeps going if there is no LA Workspace.
- An Azure Function App that will host the function. Consumption plan is good enough.
- A Storage Accounnt with a Blob Container to receive the files
- Credentials from the remote FTP Server
- A Rebex FTP client license. The code provided uses the Rebex SFTP Nuget package and needs a license key. You can get it here: https://www.rebex.net/sftp.net/
- This solution is an alternative to Logic Apps:
https://azure.microsoft.com/en-us/resources/templates/101-logic-app-ftp-to-blob/ - An Azure Function is a lot more extensible than Logic Apps. You can add some fancy file processing, save stuff to a database or be part of a larger workflow with durable functions.