Cloud PlatformsComplete guide

Azure Data Factory & ETL

Azure Data Factory is a managed data-integration and orchestration service for moving, transforming, scheduling, and monitoring data across cloud and on-premises systems.

Overview

ADF pipelines compose copy, transformation, control-flow, notebook, stored-procedure, and custom activities into parameterized workflows. Linked services describe connection and compute information, datasets describe the data an activity reads or writes, and integration runtimes provide network reach and execution capability through Azure, self-hosted, or Azure-SSIS models. Reliable production pipelines do more than report green activity status: they establish an incremental boundary, persist committed state separately from in-flight work, make sinks idempotent, validate counts, schema, freshness, duplicates, and business rules, reconcile source and target, and advance the watermark only after durable success. Managed identity, Key Vault references, private connectivity, source-controlled deployment, environment parameters, diagnostic logs, lineage, cost controls, and replay runbooks complete the operating model. Copy activity is optimized for movement; complex transformation may belong in mapping data flows or specialized engines that ADF orchestrates. New analytics programs should also evaluate Data Factory capabilities in Microsoft Fabric while matching product choice to existing platform, governance, region, connector, and operational needs.

What you will learn

  • Explain pipelines, activities, linked services, datasets, triggers, parameters, and integration runtimes.
  • Choose Copy activity, mapping data flow, stored procedures, notebooks, or external compute by workload shape.
  • Design full, incremental, CDC, partitioned, and metadata-driven ingestion.
  • Build restartable watermark processing with idempotent sinks and reconciliation.
  • Secure identities, credentials, networks, and self-hosted runtime hosts.
  • Test data correctness separately from orchestration success.
  • Deploy, monitor, tune, replay, and recover production pipelines.

Prerequisites

  • Batch data movement, SQL queries, files, object storage, schemas, and ETL versus ELT.
  • Azure managed identity, RBAC, Key Vault, networking, and private endpoint basics.
  • Source control, environment promotion, monitoring, and incident response concepts.
  • A .NET 10 SDK to run the dedicated incremental pipeline model.

When to use Azure Data Factory & ETL

Good fit

  • Use ADF when managed orchestration, broad connectors, hybrid data movement, scheduling, and visual or JSON pipeline operations fit the workload.
  • Use Copy activity for scalable movement with minimal transformation.
  • Use mapping data flows or an external analytical engine for distributed transformations.
  • Use a self-hosted integration runtime only when private or on-premises reach requires customer-managed compute.

Choose another approach when

  • Do not use ADF as a low-latency request/response or event-stream processor.
  • Do not perform large complex transformations in orchestration expressions.
  • Do not clone one pipeline per table when metadata-driven parameters can safely reuse behavior.
  • Do not treat activity success as proof that data is correct and complete.

Key concepts

Pipeline orchestration

Pipelines compose copy, transformation, control-flow, notebook, stored-procedure, and custom activities with dependencies and parameters.

Connections and data

Linked services describe connection information while datasets identify the input and output data used by activities.

Integration runtime

Azure, self-hosted, and Azure-SSIS runtimes provide compute and network reach for data movement, activity dispatch, and package execution.

Incremental boundaries

Watermarks, change tracking, or CDC define a stable source range between committed and captured high-water marks.

Idempotency and replay

Upserts, deduplication keys, immutable partitions, and transactional merges make retries and backfills safe.

Data quality

Counts, schemas, freshness, nulls, duplicates, business rules, quarantine, and reconciliation prove useful output.

Triggers and parameters

Schedules, events, tumbling windows, dependencies, metadata, and parameters drive reusable execution.

Operations and lineage

Run history, metrics, diagnostics, alerts, ownership, lineage, replay, retention, and cost make pipelines supportable.

Architecture

Triggers start parameterized ADF pipelines, an integration runtime reaches source systems, activities move or transform data, and validated results land in governed analytical storage.

Triggers + metadata
ADF pipeline
Integration runtime
Curated data + monitoring

Conceptual architecture · Adapt to your system context

Implementation walkthrough

Build the critical path deliberately, then verify its observable behavior.

  1. 01

  2. 02

  3. 03

  4. 04

  5. 05

  6. 06

  7. 07

Code example

A parameterized Copy activity passes a watermark to the source dataset and writes through a configured sink dataset.

pipeline-copy-orders.json
{
  "name": "CopyOrdersIncrementally",
  "properties": {
    "parameters": {
      "watermark": { "type": "String" }
    },
    "activities": [
      {
        "name": "CopyChangedOrders",
        "type": "Copy",
        "inputs": [
          { "referenceName": "OrdersSource", "type": "DatasetReference",
            "parameters": { "watermark": "@pipeline().parameters.watermark" } }
        ],
        "outputs": [
          { "referenceName": "OrdersLake", "type": "DatasetReference" }
        ],
        "policy": { "retry": 3, "retryIntervalInSeconds": 30 }
      }
    ]
  }
}

Testing strategy

Test definitions, data correctness, failure replay, real connectivity, and representative scale as separate concerns.

  • Unit- or contract-test pipeline JSON, required parameters, expressions, dataset references, and environment substitutions.
  • Use small deterministic fixtures for initial load, no-change run, one delta, update, delete or tombstone, duplicate, and late arrival.
  • Inject failure before write, during write, after write, during validation, and before watermark commit; reruns must converge safely.
  • Validate row counts, checksums or aggregates, schema, freshness, duplicates, nullability, business rules, and rejected records.
  • Test integration-runtime connectivity and least-privilege access from the actual network boundary.
  • Run scale tests with representative partition skew, file sizes, concurrency, source pressure, sink pressure, and recovery backlog.

Security considerations

Secure source, target, orchestration state, integration runtime, credentials, network paths, and copied data end to end.

  • Prefer managed identity and Key Vault references; keep credentials out of linked-service JSON, parameters, logs, and repository history.
  • Grant source read, target write, and control-state access separately at the narrowest practical scope.
  • Use managed virtual network, private endpoints, firewall rules, or self-hosted runtime only according to a documented threat model.
  • Harden self-hosted runtime hosts with patching, restricted administration, outbound controls, monitoring, capacity, and high availability.
  • Classify sensitive fields, encrypt transport and storage, minimize copied data, and enforce retention and regional requirements.
  • Redact pipeline parameters, queries, file paths, errors, and diagnostic payloads that could reveal secrets or personal data.

Performance and scalability

Find the constrained stage first, then tune partitioning, files, bulk operations, runtime capacity, and concurrency together.

  • Measure source read, integration-runtime throughput, network, transformation, and sink write separately before scaling concurrency.
  • Partition large ranges and files by a selective balanced key while preserving source and sink capacity.
  • Prefer appropriately sized files and bulk writes over many tiny files or row-by-row operations.
  • Use staged copy, compression, parallel copy, data integration units, and self-hosted nodes only after measurement.
  • Avoid overlapping runs for the same mutable boundary unless control state and sink semantics support it.
  • Track throughput, queue time, activity duration, retries, throttling, skew, file count, runtime utilization, freshness, and cost per load.

Deployment and operations

Promote source-controlled definitions and prerequisites safely while preserving triggers, state, replay, and rollback boundaries.

  • Keep factories connected to source control and promote reviewed publish artifacts or infrastructure templates through environments.
  • Parameterize endpoints, database names, vault references, runtime references, labels, and schedules without parameterizing away governance.
  • Provision identities, roles, network paths, private DNS, vault access, and runtime capacity before enabling triggers.
  • Disable production triggers during incompatible migrations and preserve resumable state across deployment.
  • Canary with a bounded table or partition, compare reconciled output, then expand metadata scope and concurrency.
  • Maintain backfill, replay, watermark repair, source retention, target rollback, and regional recovery procedures.

Common problems and fixes

The pipeline succeeds but data is missing

Likely cause: The watermark advanced too early, the query boundary excluded rows, late data arrived, or only activity status was checked.

Fix: Compare committed and high watermarks, inspect inclusive/exclusive predicates, reconcile source and sink, replay the affected closed range, and delay commit until validation.

A retry creates duplicates

Likely cause: The sink appends without a deterministic key or the write and progress update are not replay-safe.

Fix: Use merge/upsert, immutable partition replacement, deduplication keys, or transactional staging and rerun the same range.

Copy throughput is unexpectedly low

Likely cause: Source query, small files, runtime capacity, network, partition skew, throttling, or sink commits limit the path.

Fix: Measure each stage, inspect runtime metrics and throttles, tune query and partitions, batch files, and raise concurrency only where capacity exists.

Self-hosted runtime is offline

Likely cause: The host, service, registration, outbound connectivity, certificate, DNS, proxy, patch, or capacity state failed.

Fix: Check node health and logs, service identity, outbound endpoints, proxy/DNS, version consistency, queue, and high-availability nodes.

Authentication works in development but not production

Likely cause: Identity, RBAC scope, vault access, connector mode, DNS, firewall, or private endpoint differs.

Fix: Inspect the factory and runtime identity, data roles, linked-service authentication, token audience, secret reference, and deployed network path.

Schema drift breaks or silently corrupts a load

Likely cause: Source changes were neither rejected nor mapped through an explicit compatibility policy.

Fix: Detect schema before write, quarantine incompatible data, version mappings, alert owners, and backfill after a reviewed migration.

Best practices

  • Use metadata-driven, parameterized pipelines and reusable datasets or linked services instead of cloning environment-specific workflows.
  • Prefer managed identity, Key Vault references, private connectivity where required, and least privilege.
  • Use a self-hosted runtime only when network reach demands it and operate it as production infrastructure.
  • Design incremental loads with closed ranges, durable committed state, late-data policy, and replay procedures.
  • Make sinks idempotent and validate counts, schema, freshness, duplicates, and business rules before advancing progress.
  • Deploy through source control and CI/CD with separate environments and reviewed parameters.
  • Monitor activity and data-quality outcomes, lineage, throughput, retries, runtime capacity, and cost.

Production checklist

  • Sources, targets, owners, schemas, sensitivity, volume, cadence, latency, retention, and recovery objectives are documented.
  • Incremental boundary, committed state, high-watermark capture, late arrivals, deletes, and replay semantics are defined.
  • Sinks are idempotent and validation occurs before progress is committed.
  • Managed identity, least-privilege roles, Key Vault, encryption, and network paths are verified.
  • Integration-runtime type, version, capacity, availability, patching, and monitoring meet requirements.
  • Pipeline JSON, parameters, expressions, fixtures, failure injection, data quality, and scale are tested.
  • Runs, freshness, counts, schema, duplicates, rejects, retries, throughput, lineage, and cost are monitored.
  • Backfill, quarantine, watermark repair, source-retention loss, rollback, and disaster recovery are rehearsed.

Common interview questions

What is an integration runtime in Azure Data Factory?

It is the compute and network bridge used for data movement, dispatching supported activities, transformations, and SSIS execution. Azure, self-hosted, and Azure-SSIS types serve different needs.

What is the difference between ETL and ELT?

ETL transforms data before loading the target. ELT loads data first and uses the target analytical engine for transformation; the best choice depends on scale, governance, latency, and engine capabilities.

How do you make an incremental pipeline restartable?

Persist a committed watermark separately from the captured high watermark, make writes idempotent or transactional, validate and reconcile the closed range, and advance committed state only after durable success.

When should you use a self-hosted integration runtime?

Use it when ADF must reach on-premises or private systems through customer-managed network paths. It adds host patching, availability, capacity, proxy, credential, and monitoring responsibilities.

Why is pipeline success not enough?

Activities can complete while data is incomplete, duplicated, stale, malformed, or semantically wrong. Data-quality validation and reconciliation are separate acceptance signals.

How do Copy activity and mapping data flow differ?

Copy activity specializes in efficient data movement with light mapping. Mapping data flow provides managed distributed transformations; complex workloads may instead use SQL, Spark, notebooks, or another engine orchestrated by ADF.

Dedicated GitHub sample

Clone, run, test, and modify the focused implementation created for this guide.

Verified sample

ADF Incremental Orders

A .NET 10 restartable watermark pipeline with idempotent upserts, validation-gated progress, source-controlled ADF JSON, and managed-identity Bicep.

.NET 10Azure Data FactoryETLBicep
dedicated-sampleincremental-loadwatermarkidempotency
Run
dotnet run --project src/AdfIncrementalOrders
Test
dotnet test AdfIncrementalOrders.slnx