A data platform that is deployed by clicking through a portal has no history, no review, and no reliable way back. Every environment drifts, and the day a pipeline breaks in production becomes a forensic exercise instead of a diff. Continuous integration and delivery for data engineering means treating pipelines, infrastructure, and schema definitions as code that is validated before it reaches anyone.
After this lesson you will be able to:
- Separate what belongs in Git from what belongs in the platform UI.
- Use ADF collaboration branches and pull requests correctly.
- Validate Bicep in a pipeline stage before any deployment runs.
- Parameterize environments without leaking credentials into the repository.
Prerequisites
- !An Azure DevOps or GitHub repository
- !Basic Bicep or ARM knowledge
- !ADF pipelines you have already authored
What belongs in version control
Not everything in a data estate can or should live in Git, so decide explicitly. Pipeline definitions, linked service metadata with secrets removed, datasets, triggers, Bicep templates, notebook source, and the tests that validate all of the above belong in the repository. Secrets, connection strings with keys, and runtime state do not.
The rule of thumb is that anything a new environment needs should be reconstructible from the repository plus a parameter store. If standing up a development instance requires someone to remember three manual steps, the deployment is not repeatable and the steps will be forgotten under pressure.
| Artifact | Home | Reviewed how |
|---|---|---|
| ADF pipelines and datasets | ADF Git integration | Pull request in the repo branch |
| Bicep and parameters files | Repository infra/ folder | Pull request plus validation stage |
| Notebooks and jobs | Repositories or Databricks bundle | Pull request with unit tests |
| Secrets and connection keys | Key Vault | Access policy change only |
| Trigger states and run history | The service itself | Not versioned, audited through logs |
ADF collaboration branch versus live mode
ADF has two states that confuse almost everyone at first. The collaboration branch is where editing happens: branch, merge, pull request, review. The live, published state is what actually runs when a trigger fires. Changes made in collaboration mode do nothing until someone publishes.
feature/fix-revenue-calc
| author edits pipeline, debugs with data preview
v
pull request into adf_publish
| reviewer checks JSON diff, tests in the dev factory
v
merge, then Publish from the factory
| ARM template generated, deployed to prod by the pipeline
v
live factory in production
Keep adf_publish protected so only the release pipeline or a designated maintainer can publish. Because publishing regenerates the ARM representation of the factory, a clean collaboration history gives you a readable audit of who changed which activity and when. Avoid editing production directly through the UI; if an emergency hotfix is unavoidable, back-port it into the repository immediately so the next deployment does not silently revert it.
Infrastructure as code with Bicep
Storage accounts, Synapse workspaces, factories, and key vaults are infrastructure, and they change as often as the pipelines do. Expressing them in Bicep means a development environment can be rebuilt from scratch and will match production in every property that matters.
param location string = resourceGroup().location
param environment string = 'dev'
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
name: 'stadls${environment}'
location: location
kind: 'StorageV2'
sku: { name: 'Standard_LRS' }
properties: {
isHnsEnabled: true
supportsHttpsTrafficOnly: true
minimumTlsVersion: 'TLS1_2'
allowBlobPublicAccess: false
encryption: {
services: { blob: { enabled: true } }
keySource: 'Microsoft.Storage'
}
}
}
resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' = {
name: 'adf-${environment}'
location: location
identity: { type: 'SystemAssigned' }
properties: {
repoConfiguration: {
accountName: 'contoso-ado'
projectName: 'data-platform'
repositoryName: 'adf-repo'
collaborationBranch: 'main'
rootFolder: '/'
}
}
}
Name resources with the environment suffix in the template rather than by hand, and keep per-environment values in parameter files that are themselves committed. Drift detection then becomes a comparison between template and reality instead of a conversation.
The pipeline that validates before it deploys
The value of CI is the validation stage: catch a malformed template or a missing parameter before it can reach an environment.
trigger:
branches:
include:
- main
- feature/*
stages:
- stage: Validate
jobs:
- job: TemplateCheck
pool:
vmImage: 'ubuntu-latest'
steps:
- task: AzureCLI@2
inputs:
azureSubscription: 'sp-data-platform'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az deployment group validate \
--resource-group rg-data-dev \
--template-file infra/main.bicep \
--parameters environment=dev
- stage: DeployDev
dependsOn: Validate
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
jobs:
- deployment: DeployToDev
environment: 'data-dev'
strategy:
runOnce:
deploy:
steps:
- task: AzureCLI@2
inputs:
azureSubscription: 'sp-data-platform'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az deployment group create \
--resource-group rg-data-dev \
--template-file infra/main.bicep \
--parameters environment=dev
Bind the production stage to an environment with approvals so a human confirms the release, and gate the whole deployment on green validation. The pattern scales to more environments simply by repeating the deployment stage with a different parameter file.
Proving the deployment actually worked
A successful deployment only means the resources exist. The next stage should prove that the platform still does its job, which for a data pipeline means running something end to end and checking the output, not just the status code.
A lightweight approach is a smoke test that triggers a small, known-good pipeline against a fixture dataset and asserts on the row count written to the target path. It runs in the same release pipeline immediately after deployment, and a failure blocks promotion to production rather than being discovered by a user the following morning.
from azure.identity import DefaultAzureCredential
from azure.mgmt.datafactory import DataFactoryManagementClient
import time
credential = DefaultAzureCredential()
adf = DataFactoryManagementClient(credential, subscription_id)
run = adf.pipeline_runs.create_run(
resource_group_name="rg-data-dev",
factory_name="adf-dev",
pipeline_name="pl_smoke_load_fixture",
parameters={"dt": "2026-01-01", "expectedRows": 100},
)
while True:
current = adf.pipeline_runs.get(
"rg-data-dev", "adf-dev", run.run_id
)
if current.status in ("Succeeded", "Failed", "Cancelled"):
break
time.sleep(10)
assert current.status == "Succeeded", f"smoke run {run.run_id} failed"
Three categories of test cover most regressions. Infrastructure tests confirm that a resource has the security and networking properties you expect, such as a minimum TLS version or disabled public access. Pipeline tests confirm that a known input produces a known output. Contract tests confirm that the schema of a critical dataset has not changed in a way downstream consumers would notice. Together they take minutes to run and remove the need for anyone to click through the portal after a release.
Keep the fixtures small and deterministic. A smoke test that reads a day of production data is slow, expensive, and flaky, and a flaky test gets disabled within a sprint. Ten rows with a known checksum are enough to catch the mistakes that actually occur: a broken path, a missing parameter, a mapping that no longer resolves.
Run these checks in the same order every time, and record the result against the release. When a defect does escape, the first question is which check should have caught it. If the answer is none of them, that is a gap in the suite rather than a gap in the team's discipline.
Parameterizing environments without secrets in Git
Environment differences fall into three buckets: names and sizes, feature switches, and secrets. The first lives in parameter files, the second in pipeline variables, and the third in Key Vault referenced by the linked service or pipeline. Never the third in the first.
In ADF, give a linked service a Key Vault reference instead of an inline connection string, and store the Key Vault URI per environment as a variable group. In Bicep, pull secret values from Key Vault at deployment time or, better, grant the resource's managed identity access so no value is ever passed at all. The test for whether you got this right is simple: hand the repository to a new engineer with no access, and confirm they can read every configuration value without reading any secret.
Common Mistakes
Editing pipelines directly in the production factory
Fix: Change the collaboration branch, review through a pull request, then publish so the change is recorded.
Committing connection strings with keys to parameter files
Fix: Store secrets in Key Vault and reference them from linked services or deployment parameters.
Skipping the validation stage because deployments usually work
Fix: Always run az deployment group validate first; it catches template errors in seconds instead of in production.
Allowing anyone to publish to adf_publish
Fix: Protect the publish branch so only the release pipeline or a maintainer can merge into it.
Best Practices
- Keep one repository per platform area containing pipelines, infra, and tests
- Rebuild development from templates regularly to prove nothing is manual
- Tie every release to a commit id recorded in the pipeline run
- Use environment approvals for production and none for development
- Back-port any emergency UI fix into the repository the same day
Questions interviewers ask about CI/CD
đ¯Interview Tip
Expect to be asked how you would promote a change that touches both infrastructure and an ADF pipeline. The strong answer covers ordering: validate templates, deploy infrastructure first, then publish the factory, then run an integration test, with each step visible as a separate stage.
Interview Questions
Q1: How does ADF Git integration work?
You connect the factory to a repository, work on a collaboration branch inside ADF Studio, merge through pull requests, and publish to produce the live ARM representation. Editing and execution stay separate, so nothing changes for running triggers until publish.
Q2: How do you parameterize across environments?
Names and sizes go in per-environment parameter files, feature switches in pipeline variables, and secrets in Key Vault referenced by linked services. Environment-scoped service connections keep each stage deploying to its own subscription.
Q3: What is the recommended pattern for releasing ADF changes?
Feature branch, pull request into the publish branch, validation stage running template checks, deployment to development, automated smoke test, then an approval-gated production deployment from the same artifact.
Q4: How would you roll back a bad release?
Revert the commit and redeploy, which restores both infrastructure and factory state from source. For infrastructure you can also redeploy the previous template version. Because live state is generated from source, rollback is a deploy rather than a manual repair.
Key Takeaways
- Collaboration branch for editing, live state for running, publish as the bridge
- Reconstruct every environment from the repository plus a parameter store
- Validation belongs in its own stage before any deployment
- Secrets live in Key Vault and never in committed parameters
- Approval gates belong on production, not on development
- Rollback is a redeploy of a previous commit when state comes from source