Need to replicate Azure SQL DB source tables (more than one) to an Azure Managed SQL Instance using ADF

Ashwani SRIVASTAVA 60 Reputation points
2024-01-12T00:58:41.33+00:00

I am looking to actively replicate SQL tables from an Azure SQL database to Managed Instance SQL database. The replication needs to be ongoing for all the future changes. For this, I have enabled CDC on multiple SQL tables in Azure SQL db. Is there a way to setup replication using ADF pipelines?

Azure SQL Database
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
SQL Server Other
{count} votes

Accepted answer
  1. phemanth 15,755 Reputation points Microsoft External Staff Moderator
    2024-01-16T07:13:06.1233333+00:00

    @Ashwani SRIVASTAVA
    You’re correct that the blog you’re referring to is about replicating CDC information data (e.g., lsn, data change, etc.) but not the data itself. The blog post describes how to migrate the changes made on CDC enabled tables to another Azure SQL DB using ADF pipelines.

    Regarding your issue with the “ForEach Loop” only replicating data for the first table, it could indeed be due to the checkpoint key. The checkpoint key is used to set the checkpoint when a data flow is used for change data capture.

    In Azure Data Factory, when you enable native change data capture or auto incremental extraction options in mapping data flow, ADF helps you manage the checkpoint to ensure each activity run will automatically only read the source data that has changed since the last time the pipeline ran.

    The default checkpoint key is a hash of the data flow name and the pipeline name. If you’re using a dynamic pattern for your source tables or folders, you may wish to override this hash and set your own checkpoint key value.

    For example, if you’re using a parameter in the data flow, you can set the Upsert_Key_Column parameter in the data flow to @item().UpsertKeyColumn. Then, in the Sink settings, select Custom Expression for Key columns and enter the following expression: split($upsert_key_column,',').


0 additional answers

Sort by: Most helpful

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.