How to execute a trigger based on Blob created in Azure Data Factory?

Alan Gutierrez Encizo 41 Reputation points
2021-10-11T17:00:29.483+00:00

Hey folks!

I have pipeline executes with a trigger every time that a blob storage is created. Sometimes the process needs to execute many files at once, so I created in my pipeline a 'For Each' activity as follow, in order to load data when multiple blob storages are created

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,876 questions
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,935 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,740 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,451 Reputation points Microsoft Employee
    2021-10-12T09:52:51.223+00:00

    Hi @Alan Gutierrez Encizo ,

    Thank you for posting query in Microsoft Q&A Platform.

    Event based trigger actually runs your pipeline when ever configured event occurs on storage.

    In your case, trigger configured to run your pipeline when ever blob created with extension .xlsx, Hence when multiple files landed in it executed pipeline multiple times.

    Trigger is working as it has to be. So nothing to change there. Actually, you should consider changing your pipeline design.

    Trigger will take care of running pipeline for every file creation on storage, Hence we no need to Use GetMetaData activity to see all child items and loop them and copy them.

    What we should do is, Simply have a copy activity alone and copy only newly created file.

    Please Note, Event trigger has system parameters that gives you created file name dynamically. You can leave that system parameter to copy only newly created file.

    @trigger().outputs.body.fileName - Gives newly created file name.
    @trigger().outputs.body.folderPath - Gives Folder path.

    You can refer below video as well to understand, how event based trigger actually works.
    https://www.youtube.com/watch?v=RXEHrET9dUc

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

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.