Azure Data Factory Data Flow CDC Source Not Refreshing When Using Dynamic Table Names

Kishor kumar Reddy Akki 50 Reputation points
2026-08-25T09:07:29.6933333+00:00

Environment

  • Azure Data Factory running in a Visual Studio subscription
  • SQL Server source using CDC-enabled tables
  • AdventureWorks sample database used for testing
  • Mapping Data Flow with: 
    • Source (SQL CDC)
      • Sink (Parquet or JSON)
      • Pipeline structure:
  1. Lookup / Query activity to retrieve CDC-enabled tables
  2. ForEach activity
  3. Execute Data Flow activity

Approach:

The query successfully identifies CDC-enabled tables and passes the table names into the ForEach activity.

The ForEach activity successfully passes the current table name as a parameter into the Data Flow.

The Data Flow is configured to use this parameter to dynamically specify both the source and sink table/folder names.

For testing purposes I have used both:

  • Dataset-based sources
  • Inline sources

The behavior is identical in both scenarios.

Problem

Although the Data Flow receives a different table name parameter on each iteration, the source data does not appear to refresh correctly.

For example, I have CDC enabled on the following AdventureWorks tables:

  • Customer
  • SalesOrderHeader
  • SalesOrderDetail
  • CustomerAddress

During pipeline execution:

  • The correct table name is passed to the Data Flow on each iteration.
  • The sink location is dynamically named and may create folders corresponding to the current table.
  • However, regardless of which table is being processed, the output file always contains data from the first table processed (Customer).

This suggests that the source definition within the Data Flow is not being re-evaluated between iterations, even though the source parameter value changes.

Expected Behaviour

For each iteration of the ForEach loop:

  1. The table name parameter should be passed into the Data Flow.
  2. The Data Flow source should connect to the CDC stream for that table.
  3. The sink should contain CDC data for the current table being processed.

 I’ve attached two files to illustrate the behaviour.   adf-input.txt is the Dataflow logs indicating the source table is SalesOrderDetail. Adf-output.txt demonstrates the schema which is that of AdventureworksLT Customer table.

 

Actual Behaviour

The table parameter changes on each iteration, but the data written to the sink always contains records from the first table processed (Customer).

The sink folder name may reflect the current table name, but the file contents do not.

Question

Is this expected behaviour or a known limitation of CDC sources in Mapping Data Flows when using dynamic source table names?

If supported, are there additional configuration requirements to ensure the CDC source is reinitialized for each Data Flow execution within a ForEach loop?Environment

  • Azure Data Factory running in a Visual Studio subscription
  • SQL Server source using CDC-enabled tables
  • AdventureWorks sample database used for testing
  • Mapping Data Flow with: 
    • Source (SQL CDC)
      • Sink (Parquet or JSON)
      • Pipeline structure:
  1. Lookup / Query activity to retrieve CDC-enabled tables
  2. ForEach activity
  3. Execute Data Flow activity

Approach

The query successfully identifies CDC-enabled tables and passes the table names into the ForEach activity.

The ForEach activity successfully passes the current table name as a parameter into the Data Flow.

The Data Flow is configured to use this parameter to dynamically specify both the source and sink table/folder names.

For testing purposes I have used both:

  • Dataset-based sources
  • Inline sources

The behaviour is identical in both scenarios.

Problem

Although the Data Flow receives a different table name parameter on each iteration, the source data does not appear to refresh correctly.

For example, I have CDC enabled on the following AdventureWorks tables:

  • Customer
  • SalesOrderHeader
  • SalesOrderDetail
  • CustomerAddress

During pipeline execution:

  • The correct table name is passed to the Data Flow on each iteration.
  • The sink location is dynamically named and may create folders corresponding to the current table.
  • However, regardless of which table is being processed, the output file always contains data from the first table processed (Customer).

This suggests that the source definition within the Data Flow is not being re-evaluated between iterations, even though the source parameter value changes.

Expected Behaviour

For each iteration of the ForEach loop:

  1. The table name parameter should be passed into the Data Flow.
  2. The Data Flow source should connect to the CDC stream for that table.
  3. The sink should contain CDC data for the current table being processed.

 I’ve attached two files to illustrate the behavior. 
 adf-input.txt is the Dataflow logs indicating the source table is SalesOrderDetail. Adf-output.txt demonstrates the schema which is that of AdventureworksLT Customer table.

 

Actual Behavior

The table parameter changes on each iteration, but the data written to the sink always contains records from the first table processed (Customer).

The sink folder name may reflect the current table name, but the file contents do not.

Question

  1. Whether dynamically changing the native CDC source table within the same Mapping Data Flow and Execute Data Flow activity is a supported design.
  2. Whether the observed behavior is expected because the CDC checkpoint, source state, or source projection is reused across ForEach iterations.
  3. Whether a separate checkpoint key, Execute Data Flow activity, Mapping Data Flow, or CDC configuration is required for each source table.
  4. Whether any additional source, schema drift, projection, or sink configuration is required to support a metadata-driven framework at this scale.
  5. Whether Microsoft can provide an official article or documented reference that confirms the supported configuration or applicable limitation.
Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.


1 answer

Sort by: Most helpful
  1. Kishor kumar Reddy Akki 50 Reputation points
    2026-08-27T11:57:37.23+00:00

    Thanks for your help with this request. we have run through the advice given and it has resolved the issue we were having.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.