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.
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
- 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.
- Symptom:
ForEachran 40 copies sequentially for hours. Cause: defaultisSequential: true. Fix: parallel with a sensiblebatchCount, 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
Keep going
Orchestrating dependencies in Airflow without sensors
Sensors burn worker slots to poll for things that could simply announce themselves. Datasets, deferrable operators and event-driven triggers do it better.
ADF Pipeline Patterns
Reference guide to the Azure Data Factory patterns that carry enterprise projects: metadata-driven loads, watermarks, error handling, and environment promotion.
ADF: tumbling window triggers are not schedule triggers
Tumbling windows are stateful — they backfill, retry per window and expose window start/end. Schedule triggers just fire and forget.
One practical note a week
Get new articles, problems and guides in your inbox.
Thanks! You're on the list. (Local demo — no email provider is wired up yet.)