Incremental Data Loading in Azure Data Factory: Watermark, CDC, and Tumbling Window Patterns
Last updated: October 2026
Quick answer: Check ADF's native change data capture first: the Change Data Capture resource (public preview) and native CDC in mapping data flows cover sources such as Azure SQL Database, SQL Server, Azure SQL Managed Instance, Cosmos DB and Snowflake, and Microsoft recommends native CDC as the simplest option where it applies. For everything else, including Oracle, use a watermark column, Azure SQL change tracking, or tumbling window triggers for time-partitioned data. Update the watermark only after a successful copy. ADF pipelines are batch only, so a sub-minute change feed needs a streaming tool such as Debezium outside ADF.
Introduction
Incremental loading, pulling only the records that are new or changed since the last run, is how you scale data ingestion without overloading your source systems. This guide covers four patterns: a watermark column (best for tables with a reliable modified date or increasing ID), Azure SQL change tracking (which also captures deletes), Debezium-based CDC through Event Hubs (when you need a change feed outside ADF), and tumbling window triggers (for data partitioned by time). Each comes with SQL you can adapt and the gotchas you'll hit in production. For the basics of creating pipelines in ADF, check our getting-started guide.
Start with ADF's Native CDC Where It Fits
Microsoft documents four built-in ways to get changed data, and recommends native CDC as the simplest where your source supports it. The Change Data Capture resource runs continuously and supports Avro, Azure Cosmos DB (SQL API), Azure SQL Database, Azure SQL Managed Instance, delimited text, JSON, ORC, Parquet, SQL Server, XML and Snowflake sources; it is still in public preview, is available in ADF but not Synapse, and can't use a self-hosted integration runtime. Native CDC in mapping data flows covers SAP CDC, Azure SQL Database, SQL Server, Azure SQL Managed Instance, Azure Cosmos DB and Snowflake. Auto incremental extraction in mapping data flows handles files in Blob Storage and ADLS and several databases, including Azure Database for MySQL and PostgreSQL. Everything else, Oracle included, uses the customer-managed watermark pattern below.
Pattern 1: Watermark-Based Incremental Load
The watermark pattern is the simplest and most common. You store a "last loaded" timestamp in a control table, and each pipeline run filters source records where modified_date > @lastWatermark. After a successful copy, you update the watermark to the maximum modified_date from the current batch.
Setting Up the Control Table
-- Control table in your target database
CREATE TABLE etl.watermark_control (
table_name VARCHAR(255) PRIMARY KEY,
last_watermark DATETIME2,
last_run_status VARCHAR(20),
last_run_time DATETIME2
);
-- Initialize for each table
INSERT INTO etl.watermark_control VALUES
('orders', '1900-01-01', 'SUCCESS', GETDATE()),
('customers', '1900-01-01', 'SUCCESS', GETDATE());
The ADF Pipeline Flow
The pipeline has 3 activities chained with On Success dependencies:
- Lookup Activity: reads the current watermark from
etl.watermark_control - Copy Activity: copies records where
modified_date > @lastWatermark AND modified_date <= @currentTime - Stored Procedure Activity: updates the watermark to
@currentTimeonly on success
-- Stored procedure to update watermark
CREATE PROCEDURE etl.usp_update_watermark
@table_name VARCHAR(255),
@new_watermark DATETIME2
AS
BEGIN
UPDATE etl.watermark_control
SET last_watermark = @new_watermark,
last_run_status = 'SUCCESS',
last_run_time = GETDATE()
WHERE table_name = @table_name;
END;
Critical gotcha: The stored procedure MUST connect to the Copy Activity's On Success dependency, not run in parallel. If you update the watermark before the copy completes and the copy fails, you'll permanently skip those records. This is the single most common mistake in ADF incremental pipelines.
Handling Late-Arriving Data
Source systems don't always write records in timestamp order. A record created at 2:00 PM might not get committed until 2:15 PM due to long transactions. Add a buffer to your filter:
-- Instead of: WHERE modified_date > @lastWatermark -- Use: WHERE modified_date > DATEADD(HOUR, -2, @lastWatermark) -- AND modified_date <= @currentTime
This re-processes the last 2 hours of data on each run. To make this safe, use MERGE (upsert) at the target so duplicate records update instead of creating duplicates.
Pattern 2: Azure SQL Change Tracking
If your source is Azure SQL Database, you can use its built-in Change Tracking feature. CT records which rows changed (INSERT, UPDATE, DELETE) since a specific version number, without requiring a modified_date column on every table.
-- Enable change tracking on the database
ALTER DATABASE MyDB SET CHANGE_TRACKING = ON
(CHANGE_RETENTION = 3 DAYS, AUTO_CLEANUP = ON);
-- Enable on specific tables
ALTER TABLE dbo.orders ENABLE CHANGE_TRACKING
WITH (TRACK_COLUMNS_UPDATED = ON);
In your ADF pipeline, the Lookup Activity reads the last-synced version from your control table, and the Copy Activity uses CHANGETABLE(CHANGES ...) to get only the changed rows. The advantage over watermark: CT captures deletes, which watermark-based approaches miss entirely.
Tradeoff: Change Tracking has a retention period (3 days in the example above). If your pipeline doesn't run for longer than the retention period, you'll get an error because the change tracking data has been cleaned up. You'll need a full reload to recover.
Building this out on your own stack? We build data platforms end to end: ingestion, transformation, orchestration, and the alerting that catches a broken load before your users find it. You get running pipelines and the runbook to operate them, not a reference architecture.
Book a platform call Data engineering servicesPattern 3: CDC with Debezium via Event Hubs
For a continuous change feed, Debezium captures every change from the database's transaction log and pushes it to a Kafka-compatible endpoint, which in Azure can be Event Hubs with the Kafka protocol enabled. Debezium runs as a connector in a Kafka Connect cluster, reads the SQL Server, PostgreSQL or MySQL transaction log, and writes change events to Event Hubs.
ADF has no trigger that listens to Event Hubs, and its pipelines are batch only, so ADF sits at the end of this design. A common arrangement is Event Hubs Capture writing the events to files in storage, which a storage event trigger or a schedule then loads. Anything that needs the events within seconds reads Event Hubs directly with a streaming engine.
When to use this over watermark: you need to capture deletes, your source tables don't have a reliable modified_date column, or other systems need the same change feed. Sub-minute latency is possible on the streaming side, but not through an ADF pipeline, whose smallest schedule interval is one minute.
Pattern 4: Tumbling Window Triggers
Tumbling window triggers are ADF's way of handling time-partitioned incremental loads. Each trigger execution has WindowStart and WindowEnd system variables representing a non-overlapping time slice. They're ideal for data that's naturally partitioned by date, such as daily log files or hourly event data. The variables are available in the trigger definition, so you pass them to pipeline parameters there and use the parameters in the pipeline:
// Trigger definition: map the window boundaries to pipeline parameters
"pipeline": {
"pipelineReference": { "referenceName": "LoadEvents", "type": "PipelineReference" },
"parameters": {
"windowStart": "@trigger().outputs.windowStartTime",
"windowEnd": "@trigger().outputs.windowEndTime"
}
}
-- Copy Activity source query, using the pipeline parameters
SELECT * FROM events
WHERE event_date >= '@{pipeline().parameters.windowStart}'
AND event_date < '@{pipeline().parameters.windowEnd}'
Tumbling windows handle backfills when the trigger's start time is in the past: the trigger runs each window from oldest to newest, with a concurrency setting between 1 and 50. A window that fails is retried only if you set a retry policy, which defaults to no retries, or when you rerun it from Monitoring.
Gotcha: the minimum tumbling window interval is 5 minutes. If you need more frequent runs, use a schedule trigger, which supports intervals down to 1 minute. A manual or Debug run has no window, so give the pipeline parameters default values for testing.
Advanced: Metadata-Driven Multi-Table Incremental Loads
Building a separate pipeline for each table doesn't scale. The metadata-driven pattern uses a single pipeline with a ForEach loop that iterates over a configuration table listing all source tables, their watermark columns, target destinations, and load patterns.
-- Metadata configuration table
CREATE TABLE etl.pipeline_config (
source_schema VARCHAR(128),
source_table VARCHAR(128),
watermark_column VARCHAR(128),
target_schema VARCHAR(128),
target_table VARCHAR(128),
load_type VARCHAR(20), -- 'incremental' or 'full'
is_active BIT DEFAULT 1
);
INSERT INTO etl.pipeline_config VALUES
('dbo', 'orders', 'modified_date', 'staging', 'orders', 'incremental', 1),
('dbo', 'customers', 'updated_at', 'staging', 'customers', 'incremental', 1),
('dbo', 'products', NULL, 'staging', 'products', 'full', 1);
The ADF pipeline uses a Lookup to read etl.pipeline_config WHERE is_active = 1, then a ForEach activity iterates over the results. Inside the ForEach, parameterized Copy Activities dynamically set the source table, watermark filter, and target table based on each config row. One pipeline handles 50+ tables. For a detailed walkthrough of this pattern, see our guide on Azure SQL to Snowflake pipelines.
Monitoring and Alerting
ADF pipelines fail silently if you don't set up monitoring. Configure ADF diagnostic settings to send pipeline run logs to Log Analytics, then create alerts for:
- Pipeline failures: Any pipeline run with status "Failed"
- Duration anomalies: Pipeline runs taking 2x longer than the 7-day average
- Zero-row copies: A Copy Activity that succeeds but copies 0 rows might indicate a source issue
- Watermark staleness: If
last_run_timein your control table is more than 2x the expected interval, something's stuck
Key Takeaways
- Check ADF's native CDC first. Microsoft recommends it as the simplest option where your source is supported.
- The watermark pattern works with any supported database, Oracle included, and is the usual choice when native CDC doesn't fit.
- Always update watermarks AFTER a successful copy, never before, using On Success dependencies.
- Add a 1-2 hour buffer to watermark filters and use MERGE or upsert at the target to handle late-arriving data safely.
- Azure SQL Change Tracking captures deletes but has a retention window; if your pipeline stops for longer than that, you need a full reload.
- Tumbling window triggers have a 5-minute minimum interval, and ADF pipelines are batch only. Use schedule triggers for higher frequency and a streaming tool for continuous feeds.
- The Copy Activity's upsert loads each batch into a temporary table and then updates or inserts into the target, so avoid overlapping runs against the same table.
- Metadata-driven pipelines with ForEach loops let one pipeline handle 50+ tables without duplicating logic
CelestInfo Engineering Team
We build data pipelines on Azure, Snowflake, and Databricks. If your incremental loads are breaking at 3am, we've probably seen the same problem. About us
Related Articles
Burning Questions About ADF Incremental Loads
Ready? Let's Talk!
Get expert insights and answers tailored to your business requirements and transformation.
Get Assistance