How rvkumar1398/adf-onprem-migration-project works
Purpose and Deployment Model
This is Azure Data Factory (ADF) source control for a metadata-driven incremental migration from on-premises SQL Server to Azure Data Lake Storage Gen2 (ADLS Gen2). The factory definition is factory/adfdevRwSAP.json; ADF Git integration restores and publishes these artifacts.
Entry Point and Orchestration
pipeline/MasterPipeline.json is the operational entry point. It reads all tracked source-table records from the SQL watermark/control table, then iterates them with a ForEach. Each iteration invokes the reusable child pipeline with the table-specific schema, table name, watermark column, and prior load value.
The key control boundary is the watermark table dbo.ADF_Watermark_Table: it determines which tables are processed and provides each table’s incremental checkpoint.
Per-Table Incremental Load
pipeline/PL_Child_Incremanta.json executes one table load. It:
1. Retrieves the current maximum source watermark.
2. Compares that value with the control-table LastLoadValue.
3. Conditionally copies only rows beyond the prior watermark.
4. Calls dbo.UpdateWatermark after a successful copy.
This separates fleet-wide orchestration from table-level extraction and makes the child pipeline parameter-driven.
Source Access and Runtime Boundary
The source is on-premises SQL Server, represented by linkedService/SqlServer2.json (with another SQL linked-service artifact at linkedService/SqlServer1.json). Connectivity crosses the cloud/on-premises boundary through the self-hosted integration runtime in integrationRuntime/integrationRuntime1.json.
The runtime is architecturally required: ADF activities execute against the local SQL environment through it, while credentials and runtime registration must be supplied outside Git.
Dataset Contracts
dataset/DS_LKUP_MAX_VALUE.json is the parameterized SQL dataset used for per-table maximum-watermark lookup. dataset/DS_ADLS_SINK_PARQUE.json defines the parameterized Parquet sink target. These artifacts form the data contract between child-pipeline parameters and source/sink paths.
Lake Sink and Storage Services
Incremental rows land in the rawdata ADLS Gen2 container as Parquet, partitioned by table and date. linkedService/LS_ADLS_Gen2.json is the primary lake connection. Additional storage/REST artifacts exist in linkedService/AzureDataLakeStorage.json, linkedService/LSAzureBlobStorage.json, and linkedService/LS_REST_PARQUTE.json, but the documented migration path uses ADLS Gen2.
State, Reliability, and External Dependencies
The watermark update occurs only after the conditional copy path, preserving the intended “advance checkpoint after load” flow. Correctness depends on source watermark monotonicity, SQL stored procedure dbo.UpdateWatermark, the on-premises SQL control table, available self-hosted IR, and the ADLS account/container. Secrets are intentionally absent from repository artifacts and must be reconfigured when rebuilding.
Main entry points: PL_Child_Incremanta.json Incremental Parquet copy · MasterPipeline.json Master pipeline · DS_LKUP_MAX_VALUE.json Max watermark dataset · SqlServer2.json SQL linked service
Components 16
Azure Data Factory
- ADF factory definition · Git-published factory definition.
factory/adfdevRwSAP.json - Master pipeline · Operational fleet-wide entry point.
pipeline/MasterPipeline.json - ForEach table records · Supplies per-table schema, name, watermark, and checkpoint.
pipeline/MasterPipeline.json - Incremental child pipeline · Executes one table incremental load.
pipeline/PL_Child_Incremanta.json - Get current max watermark
pipeline/PL_Child_Incremanta.json - Max watermark dataset
dataset/DS_LKUP_MAX_VALUE.json - Compare checkpoints · Copies only when source data exceeds LastLoadValue.
pipeline/PL_Child_Incremanta.json - Incremental Parquet copy · Extracts rows beyond the prior watermark.
pipeline/PL_Child_Incremanta.json - SQL linked service
linkedService/SqlServer2.json - Self-hosted integration runtime · Provides ADF access to local SQL Server.
integrationRuntime/integrationRuntime1.json - Parquet sink dataset
dataset/DS_ADLS_SINK_PARQUE.json - ADLS Gen2 linked service
linkedService/LS_ADLS_Gen2.json
On-premises SQL Server
- Watermark control table · Tracks enabled tables and prior load values.
- UpdateWatermark procedure · Advances the checkpoint only after a successful copy.
- Source SQL tables · Business tables selected by metadata.
ADLS Gen2
- rawdata Parquet landing · Partitioned by table and date.
Connections 18
- ADF factory definition → Master pipeline: publishes
- Master pipeline → Watermark control table: reads tracked tables
- Master pipeline → ForEach table records: iterates
- ForEach table records → Incremental child pipeline: invokes with parameters
- Incremental child pipeline → Get current max watermark: retrieves maximum
- Get current max watermark → Max watermark dataset: uses
- Max watermark dataset → SQL linked service: connects through
- SQL linked service → Self-hosted integration runtime: uses
- Self-hosted integration runtime → Source SQL tables: reaches on-premises
- Get current max watermark → Compare checkpoints: current value
- Watermark control table → Compare checkpoints: LastLoadValue
- Compare checkpoints → Incremental Parquet copy: when new rows exist
- Source SQL tables → Incremental Parquet copy: incremental rows
- Incremental Parquet copy → Parquet sink dataset: writes via
- Parquet sink dataset → ADLS Gen2 linked service: uses
- ADLS Gen2 linked service → rawdata Parquet landing: lands Parquet
- Incremental Parquet copy → UpdateWatermark procedure: on success
- UpdateWatermark procedure → Watermark control table: updates checkpoint