2
votes

Can someone please recommend the best way of doing this using Azure Logic App:

The scenario that i have is to:

i) Connect to SFTP Server

ii) Get csv file from the SFTP Server

iii) Parse the csv file and move the load to an Azure SQL Database Table

After getting the csv file from the SFTP server using the SFTP Connector, should i pass the content of the file to an Azure Function?

Then in the Azure Function, parse the file content and then use a stored procedure within the Function?

Or pass the transformed file content back to the logic app to execute the stored procedure to insert the records into Azure SQL?

Or any other recommendations

1

1 Answers

2
votes

This video and walkthrough is a bit dated but still relevant and does almost exactly this. Just replace “API App” with Function.

video here

To keep a function doing only one thing I’d likely go:

  1. SFTP trigger
  2. Pass in CSV to function and have it return JSON
  3. Call a stored proc in Logic Apps and pass in Function JSon output. Expect OPENJSON in SQL would play nicely here

Let us know if you have any other ?s