4

I am invoking an ADF V2 pipeline via an event based trigger when new files/blobs are created in a folder within a blob container.

Blob Container structure:

BlobContainer -> FolderName ->

-> File1.csv

-> File2.csv

-> File3.csv

I've created the trigger with below configuration:

Container Name: BlobContainer

Blob path begins with: FolderName/

Blob path ends with: .csv

Event Checked:Blob Created

Trigger Screenshot

Problem: Three csv files are created in the folder on ad hoc basis. The trigger that invokes the pipeline runs 3 times (probably because 3 blobs are created). The pipeline actually move the files in another blob container. So the 1st trigger run succeeds and remaining 2 fails because the files have been moved already. However how can I configure the trigger so that it only run once per folder even though 3 files are created within it?

Because the files are generated together, I am required to move them together into a new location using ADF.

1 Answer 1

1

Your blobEventTrigger triggered the pipeline for each file, For it, you can use a 'lookup activity' which gets the filenames and then use filter activity, which filtered the required filename and gives the filterdItemCounts attribute that could be checked in the IF Activity. When there is no file the filterdItemCounts returns '0'and your pipeline not triggered.

Summary- Lookup Activity -> Filter Activity -> IF Activity -> Your Pipeline

Sign up to request clarification or add additional context in comments.

3 Comments

I am also having the same question. How can Lookup activity get the filenames? Can you elaborate please?
you can use "parameters": { "fileName": "@triggerBody().fileName"} Parameter in your trigger and this filename can be also used in the Lookup activity for your file.
I would suggest to take a look on similar issue stackoverflow.com/questions/64504159/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.