Azure Logic App SFTP-SSH When File is Added or Modified trigger download all files

H20Boater 25 Reputation points
2023-10-17T21:44:10.49+00:00

I have created an Azure Logic App that uses the SFTP-SSH trigger of "When a file is added or Modified". Our SFTP site has 2 files added to it at specific times of the day. I have the how often do you want to check set so that it will check the site when we expect the new files. The trigger successfully connects and notices new files and I am able to download those files and create new files in an Azure File Store. However, it only downloads one of the 2 files.

I know that I could follow the trigger with a List files and then a for each get file contents but this causes an error where the get file content states that the path does not exist.

How can I reliably get both files downloaded? This is the flow that triggers and only downloads 1 file

2023-10-17 15_38_35-Paycom-SFTP-Download-V2 - Microsoft Azure and 18 more pages - DK365 - Microsoft​

This is the other flow I have tried

2023-10-17 15_40_50-Paycom-SFTP-Download - Microsoft Azure and 18 more pages - DK365 - Microsoft​ Ed

This is the error I get for 1 of the 2 files

.2023-10-17 15_43_03-Logic app run - Microsoft Azure and 18 more pages - DK365 - Microsoft​ Edge

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,206 questions
{count} votes

Accepted answer
  1. Sonny Gillissen 3,351 Reputation points
    2023-10-26T20:39:54.8166667+00:00

    Hi H20Boater ,

    Thank you for reaching out on Microsoft Q&A!

    I think you should try to set the concurrency of the ‘For Each’ action to 1, as this might be a session problem.

    Could be that the concurrent iterations are now blocking each other. By setting concurrency to 1 it’s handled sequentially thus not interfering.

    Please click “Accept answer” if you find this helpful. Feel free to drop additional queries in the comments below!

    Kind regards,

    Sonny

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Sonny Gillissen 3,351 Reputation points
    2023-10-20T14:52:27.5733333+00:00

    Hi H20Boater ,

    Thank you for reaching out on Microsoft Q&A!

    Please check the trigger's 'Settings' to see whether the 'SplitOn' option is enabled. If so, turn it off.

    User's image

    When this setting is enabled the trigger will fire once per Logic App run, and therefor start multiple Logic Apps as soon as multiple files are found.

    With this setting disabled, you will receive an array of files in a single Logic App to process.

    Please click “Accept answer” if you find this helpful. Feel free to drop additional queries in the comments below!

    Kind regards,

    Sonny


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.