Moving Delta / Missing Files between Source and Sink Via Azure Data Factory / Synapse Pipeline

Problem Statement :

Is it possible to Copy only the files present in Source and not in Sink ( i.e Delta / Missing files between Source and Sink )

Prerequisites :

  1. Azure Data Factory / Synapse
  2. Azure Blob Storage

Solution :

GitHUB Code

  1. Get the list of files across Source dataset and Sink dataset via Get Meta data activity.

where Dataset settings (Binary as we need to move the files as is) are as below for Source and Sink :

2. To get the Delta / Missing files between the Source and Sink, leverage the Filter activity

Items : @activity('Get List of Source Files').output.childItems
Conditions : @not(contains(activity('Get List Of Sink Files').output.childItems,item()))

3. Use For Each Activity to iterate over the Missing files

Items : @activity('Get Delta Or Missing Files').output.value

4. Copy the Missing file in Iteration via Copy activity to Sync the Source and Sink

Source Dataset :

wherein create a Dataset Parameter : FileNm

Sink Dataset :

wherein create a Dataset Parameter : FileNm

Result :

Input :

Source Location:

Sink Location :

Output :

Get Metadata Source

Get Metadata Sink

Filter Activity :

Final Sink Location :

Published by Nandan Hegde

Microsoft Data MVP |Microsoft Data platform Architect | Blogger | MSFT Community Champion I am a MSFT Data Platform MVP and Business Intelligence and Data Warehouse professional working within the Microsoft data platform eco-system which includes Azure Synapse Analytics ,Azure Data Factory ,Azure SQL Database and Power BI. To help people keep up with this ever-changing landscape, I frequently posts on LinkedIn, Twitter and to his blog on https://datasharkx.wordpress.com. LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66 GitHUB Profile : https://github.com/NandanHegde15 Twitter Profile : @nandan_hegde15 MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942

Leave a comment

Design a site like this with WordPress.com
Get started