0
votes

For the below scenario where the left side is my source and the Right side is the destination:

Source                                                   Destination
----------                                               -----------------
sourceContainer/StaticFiles/Finance/X1.tsv               DestinationContainer/StaticFiles/Finance/X1.tsv
sourceContainer/StaticFiles/Customer/X2.tsv              DestinationContainer/StaticFiles/Customer/X2.tsv

I would want to place files at any of the source locations one at a time and it should trigger a copy pipeline to create path dynamically for destination. I have used one copy activity in a pipeline where I have created triggers for each like Finance and Customer.

I have referred to the below link, but no luck https://docs.microsoft.com/en-us/azure/data-factory/how-to-create-event-trigger

1
"No luck" isn't clear enough, Can you share what you've tried and what the result was? - Joel Cochran

1 Answers

0
votes

We need use Get Metadata and ForEach activities to achieve that. I created a simple test to copy files and create path dynamically for destination.

  1. First, we need to add a event trigger. Specify your container and path.
    enter image description here

  2. Declare a dataset of your container. enter image description here

  3. At Get Metadata1, select the dataset declared previously , then select Child items. enter image description here

  4. At ForEach1 activity, add dynamic content @activity('Get Metadata1').output.childItems to the Items. enter image description here

  5. Inside ForEach1 activity, we can define a Copy activity. Select Wildcard file path and add StaticFiles to the path. enter image description here

  6. At sink tab, we create a dataset to the destination container. enter image description here Here is output. Then add dynamic content and type in @item().name . It will create path dynamically for destination. enter image description here

Debug:
The pipeline triggered when I upload a file to the StaticFiles/finance folder. enter image description here We can see it created path dynamically for destination. enter image description here