joydeep roy
joydeep roy

Reputation: 1

Azure container sync periodically

I have a scenario where i am storing payload from 2 subscriber (Service bus topics) into 2 different storage/container. Storing mechanism are different in these case. Now i have to run a sync every 30 minutes which will compare the files created target and Source, if anything is missing in the target it should be able to copy that file from source to target.

I am looking at AZCopy sync, but that is a local application . There are logic app and Function app option as well.

Kindly share what is the best solution to this problem

Upvotes: 0

Views: 179

Answers (1)

Joel Cochran
Joel Cochran

Reputation: 7738

This method is a little on the brute force side, but should work. Here is the top level pipeline diagram:

enter image description here

Here are the steps:

  1. Get Metadata for the "Needs sync" folder (FolderA). Be sure to check add the "Child items" argument:

enter image description here

  1. ForEach over the FolderA child items to extract the file names and append them to an array variable:

enter image description here

enter image description here

This makes it easier to work with the names later.

  1. Get Metadata for the "Always right" folder (FolderB). Same process as above, but over the FolderB location.

  2. ForEach over FolderB's child items.

enter image description here

  1. Inside the ForEach, add an If Condition to test whether or not the FolderB item exists in the FolderA list.

enter image description here

enter image description here

  1. If the FolderB item is not in the FolderA list, append it to a Missing_Items array variable.

enter image description here

From here, it's a matter of looping over the Missing Items array and handling it however you prefer [probably with a Copy activity].

Upvotes: 1

Related Questions