multiple file processing using ADF - azure

I have created pipeline which does steps
Copy files from azure blob storage and save in Azure data lake store then
Then USql task pick that files and create summarize files in azure data lake store
Next task pick data from that file and save in db
I am passing 2 parameters windowStart and windowEnd and giving date ranage. Issue is it is always process 1 day not sure what is the problem
Note initially i created copy task with tumbling window trigger that copied all files from blob to ADLStore but once i added new tasks and running manually it is processing only one file.
Thanks

Related

Azure Synapse Pipeline Execution based on file copy in DataLake

I want to execute Azure Synapse Pipeline whenever a file is copied into a folder in data lake.
Can we do that and how can we achieve that?
Thanks,
Pavan.
You can trigger a pipeline (start pipeline execution) based on a file copied to datalake folder using storage event triggers. The storage event triggers can start the execution of pipeline based on a selected action.
You can follow the steps specified below to create a storage event trigger.
Assuming you have a pipeline named ‘pipeline1’ in azure synapse which you want to execute based on file copied to datalake folder, click on trigger and select New/Edit.
Choose a new trigger. Select trigger type as storage events and specify the datalake storage details on which you want to start trigger when a file is copied into it. Specify container name, blob path begins with and blob path ends with according to your datalake directory structure and type of files.
Since you need to start pipeline when a blob file appears in datalake folder, check Blob Created event. Check start trigger on action, complete creating the trigger and publish it.
These steps allow you to create a storage event trigger for your pipeline based on the datalake storage. As soon as files are uploaded or copied to the specific directory of the datalake container, the pipeline execution will be started, and you can work on further steps. You can refer to the following document to understand more about event triggers.
https://learn.microsoft.com/en-us/azure/data-factory/how-to-create-event-trigger?tabs=data-factory

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

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:
That part of the pipeline uploads the data of every blob in the container to a SQL Data Base, and here is the problem, when I execute manually everything is fine, but when the trigger is executed, it executes many times as the number of blob storages in the container, and load the data multiple times no matter what (down bellow is the trigger configuration).
What I'm doing wrong? Is there any way to execute just one time the pipeline by using a trigger when a blob storage is created no matter how many files are in the container?
Thanks by the way, best regards.
Your solution triggers on a storage event. So that part is working.
When triggered, it retrieves all files in the container and processes every blob in that container. Not working as intended.
I think you have a few options here. You may want to follow this MSFT tutorial where they use a single copy activity to a sink. Step 11 shows you have to pass the #triggerBody().path & #triggerBody().fileName to the copy activity.
The other options is to aggregate all blob storage events and use a batch proces to do the operation.
I would first try the simple one-on-one processing option first.

How to skip already copied files in Azure data factory, copy data tool?

I want to copy data from blob storage(parquet format) to cosmos db. Scheduled the trigger for every one hour. But all the files/data getting copied in every run. how to skip the files that are already copied?
There is no unique key with the data. We should not copy the same file content again.
Based on your requirements, you could get an idea of modifiedDatetimeStart and modifiedDatetimeEnd properties in Blob Storage DataSet properties.
But you need to modify the configuration of dataset every period of time via sdk to push the value of the properties move on.
Another two solutions you could consider :
1.Using Blob Trigger Azure Function.It could be triggered if any modifications on the blob files then you could transfer data from blob to cosmos db by sdk code.
2.Using Azure Stream Analytics.You could configure the input as Blob Storage and output as Cosmos DB.

Azure: Run a data factory activity when a new file is added to data lake store

I have a large dataset on Azure Data lake store and a few files might be added/updated there daily. How can I process these new files without reading the entire dataset each time?
I need to copy these new files using Data Factory V1 to SQL server.
If you could use ADF V2, then you could use get metadata activity to get the lastModifiedDate Properties of each file and then only copy new files. You could reference this doc. https://learn.microsoft.com/en-us/azure/data-factory/control-flow-get-metadata-activity

Incremental loading of files from On-prem file server to Azure Data Lake

We would like to do incremental loading of files from our on-premises file server to Azure Data Lake using Azure Data Factory v2.
Files are supposed to store on daily basis in the on-prem fileserver and we will have to run the ADFv2 pipeline on regular intervals during the day and only the new un-processed files from the folder should be captured.
Our recommendation is to put the set of files for daily ingestion into /YYYY/MM/DD directories. You can refer to this example on how to use system variables (#trigger().scheduledTime) to read files from the corresponding directory:
https://learn.microsoft.com/en-us/azure/data-factory/how-to-read-write-partitioned-data
In the source dataset, you can do file filter.You can do that by time for example (calling datetime function in expression language) or something else what will define new file.
https://learn.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions
Then with a scheduled trigger, you can execute pipeline n times during the day.

Resources