DataEng Hub
Azure Data FactoryintermediateArticle · 2 min read

Parameterizing ADF pipelines across environments

One pipeline definition, three environments: global parameters, parameterized linked services and a metadata table — instead of dev/test/prod copy-paste.

Balaji S.
Lead Data Engineer

TL;DR

  • Hard-coded connection strings are why your ADF release pipeline has a 400-line parameter file. Parameterize linked services and the problem mostly disappears.
  • Global parameters carry environment facts (environment name, key vault URL); pipeline parameters carry run facts (load date, table name).
  • A metadata table turns 40 copy-pipelines into one pipeline and 40 rows.

The three layers

Layer Holds Example
Global parameters Environment identity env = "prod", kv_url
Linked service parameters Connection shape storage account name, SQL server
Pipeline parameters Run-specific values p_table, p_watermark

Parameterized linked service

One linked service that any dataset can point at a different storage account:

{
  "name": "LS_ADLS_Dynamic",
  "properties": {
    "type": "AzureBlobFS",
    "parameters": {
      "storageAccountName": { "type": "String" }
    },
    "typeProperties": {
      "url": "https://@{linkedService().storageAccountName}.dfs.core.windows.net"
    }
  }
}

Secrets never live here — reference Key Vault, and let each environment's Key Vault hold its own values.

Metadata-driven loads

One ForEach over a control table replaces a pipeline per source:

CREATE TABLE etl.load_config (
  source_schema  VARCHAR(50),
  source_table   VARCHAR(100),
  target_path    VARCHAR(200),
  watermark_col  VARCHAR(50),
  enabled        BIT
);

The pipeline looks up enabled rows, then each iteration copies incrementally using the row's watermark column. New source table = one INSERT, zero deployments.

CI/CD notes

  • Export with the ADF ARM template or (better) use the adf_publish-free approach: deploy from the collaboration branch with the ADF utilities npm package.
  • Override only global parameters per environment in the release; if your parameter file is long, you've under-parameterized linked services.
  • Keep triggers stopped in dev/test via a post-deployment script, not by hand.

From production: gotchas and lessons

  1. Symptom: test pipeline wrote into prod storage. Cause: a dataset bypassed the parameterized linked service with its own hard-coded one. Fix: CI check that fails the PR when a linked service has zero parameters.
  2. Symptom: ForEach ran 40 copies sequentially for hours. Cause: default isSequential: true. Fix: parallel with a sensible batchCount, and a per-source timeout.

Checklist

  • Zero hard-coded account names or connection strings in datasets
  • Secrets resolved from Key Vault per environment
  • Control table drives repetitive loads
  • Release overrides global parameters only

Further reading

#parameters#linked-services#cicd#metadata-driven

Keep going

PDF guide12 pages · v1.1

ADF Pipeline Patterns

Reference guide to the Azure Data Factory patterns that carry enterprise projects: metadata-driven loads, watermarks, error handling, and environment promotion.

One practical note a week

Get new articles, problems and guides in your inbox.