1
votes

Im setting up a logic app that should Trigger when a file is added or modified in a specific path on a FTP server and will then copy this file to a storage account. However, I have tried multiple setups within the logic app but can not seem to get it right. I want the setup to only copy the files that does not already exist in the storage account.

I have the following setup right now : When a file is added or modified (FTP) -> List files in folder (FTP) -> For each File in folder (FTP) -> Create blob

This setup will trigger correctly and will copy each file to the specified storage account.

I have also tried with different condition but it doesnt seem to work. For example I tried adding another step which was (FTP) -> List files in folder (FTP) -> List blobs -> Condition List blobs is not equal to List Files -> If TRUE -> For each File in folder (FTP) -> Create blob

Does anyone have any idea on how I can get this working?

Greetings.

1

1 Answers

1
votes

As it is hare to explain it and I think share the template is also not easy for you to deploy it. So I post the screenshots of my logic app below for your reference.

The screenshot below is the overall architecture of my logic app:

enter image description here

Below is the architecture of "For each":

enter image description here

The screenshot below is the architecture of "For each 2":

enter image description here

The screenshot below is the architecture of "Condition 2":

enter image description here

By the way, please click "..." beside your "For each" and change the settings as below screenshot shows(This change is very important because cycles in a "Foreach" loop run in parallel. If you don't do this change, the value of your variable in logic app will be incorrect. I wasted too much time here.)

enter image description here