Azure Data Factory (ADF) supports continuous integration and continuous delivery (CI/CD) for promoting pipelines, datasets, linked services, data flows, triggers, and other factory resources from development to test and production. Microsoft now provides the @microsoft/azure-data-factory-utilities npm package to validate Data Factory resources and generate ARM templates programmatically, removing the need to click Publish in the Data Factory user interface during the build stage.

This guide explains how to implement Azure Data Factory deployment using Azure DevOps with an automated build pipeline and a release pipeline. It also covers Node.js compatibility, ARM template artifacts, environment parameters, secrets, and trigger handling.

What changed in Azure Data Factory CI/CD?

The traditional ADF workflow uses Git integration for development and the adf_publish branch to store ARM templates generated when a developer selects Publish in the ADF UI. Microsoft continues to support this approach. The automated publishing flow adds a build-pipeline option: Azure DevOps validates the factory resources and generates ARM templates as build artifacts after changes are merged into the collaboration branch.

AreaTraditional flowAutomated publishing flow
ValidationPerformed through the ADF UI or pipeline tasks.Performed by the ADF Utilities npm package in the build pipeline.
ARM template generationTriggered by selecting Publish in ADF.Triggered by the Azure DevOps build pipeline.
Artifact sourceadf_publish branch.Build artifact containing generated ARM templates.
DeploymentRelease pipeline deploys the publish-branch templates.Release pipeline deploys the build artifact to each environment.
Azure Data Factory CI/CD deployment options

Prerequisites:
1. An Azure subscription and Azure DevOps organization/project.
2. An Azure Data Factory development environment connected to Azure Repos Git or GitHub.
3. A collaboration branch, such as main or master.
4. Permission to validate and deploy the target Data Factory.
5. An Azure Resource Manager service connection in Azure DevOps.
6. Node.js 20.x for the current Microsoft-recommended ADF Utilities workflow. Keep the Node.js version compatible with the package version used by your pipeline.

1. Configure package.json

Create a package.json file in the Data Factory repository. The package exposes commands for validating resources and exporting ARM templates. The following example uses the package entry point documented by Microsoft:

{ “scripts”: { “build”: “node node_modules/@microsoft/azure-data-factory-utilities/lib/index” }, “dependencies”: { “@microsoft/azure-data-factory-utilities”: “^1.0.0” } }

Use the current compatible package version from the ADF Utilities npm package. Commit both package.json and the generated lock file so the build remains repeatable.

package.json for the Microsoft Azure Data Factory Utilities npm package

2. Create the Azure DevOps build pipeline (CI)

The build pipeline should run when changes are merged into the collaboration branch. It installs Node.js and the npm dependencies, validates the Data Factory resources, exports the ARM template, and publishes the generated files as a pipeline artifact.

Important: Replace the subscription ID, resource group name, Data Factory name, branch name, and repository folder paths with values from your environment.

trigger:
- main # Change to master or your collaboration branch

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '20.x'
  displayName: 'Install Node.js'

- task: Npm@1
  inputs:
    command: 'install'
    workingDir: '$(Build.Repository.LocalPath)'
  displayName: 'Install npm dependencies'

- task: Npm@1
  inputs:
    command: 'custom'
    workingDir: '$(Build.Repository.LocalPath)'
    customCommand: 'run build validate $(Build.Repository.LocalPath) /subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.DataFactory/factories/<dev-data-factory-name>'
  displayName: 'Validate Data Factory resources'

- task: Npm@1
  inputs:
    command: 'custom'
    workingDir: '$(Build.Repository.LocalPath)'
    customCommand: 'run build export $(Build.Repository.LocalPath) /subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.DataFactory/factories/<dev-data-factory-name> ArmTemplate'
  displayName: 'Validate and generate ARM template'

- task: PublishPipelineArtifact@1
  inputs:
    targetPath: '$(Build.Repository.LocalPath)/ArmTemplate'
    artifact: 'ArmTemplates'
    publishLocation: 'pipeline'
  displayName: 'Publish ARM template artifact'

The validate command checks the resources in the configured Git folder. The export command validates the resources and generates the ARM template. The generated template is an artifact; it is not deployed to the live Data Factory by the export command.

Creating an Azure DevOps build pipeline for automated Azure Data Factory publishing
Steps to create the build pipeline for Azure Data Factory

3. Create the release pipeline (CD)

The release pipeline consumes the ARM template artifact generated by the build pipeline and deploys it to the target environment. Create separate stages for development, test, staging, and production as required.

  1. In Azure DevOps, open Pipelines → Releases.
  2. Select New release pipeline and choose the Empty job template.
  3. Provide a stage name, such as Development or Production.
  4. Select Add an artifact, choose Build, and select the build pipeline that publishes ArmTemplates.
  5. Open the stage and add the ARM Template Deployment task.
  6. Select the Azure Resource Manager service connection, subscription, resource group, and location.
  7. Set the template location to Linked artifact.
  8. Select ARMTemplateForFactory.json as the template and ARMTemplateParametersForFactory.json as the parameter file.
  9. Configure environment-specific parameter overrides, deployment name, and deployment mode.
  10. Save the release pipeline and configure the artifact continuous-deployment trigger if automatic releases are required.

Use Incremental deployment mode unless you have a specific, tested reason to use another mode. In Complete mode, resources in the resource group that are not included in the template can be deleted.

Configuring an Azure Data Factory release pipeline in Azure DevOps
Steps to configure the Data Factory release pipeline
Configuring the ARM template deployment task for Azure Data Factory
Configuring the ARM Template Deployment task

4. Manage parameters and secrets

Keep environment-specific values outside the source factory definition wherever possible. Use ARM template parameters for resource names, URLs, database names, integration runtime settings, and other values that differ between environments.

For passwords, connection secrets, and tokens, use Azure Key Vault with the Azure DevOps release pipeline. Grant the pipeline identity only the permissions it needs, and avoid committing secret values into Git, ARM templates, YAML files, or pipeline logs.

5. Handle Azure Data Factory triggers

Deployments can fail or behave unexpectedly when active triggers are updated. A common CI/CD pattern is to stop the relevant triggers before deployment and restart them afterward. Microsoft provides a pre- and post-deployment PowerShell script, including a version that stops and starts only modified triggers.

Refer to Disable and Enable Triggers in Azure Data Factory Using PowerShell for a practical implementation.

Related deployment topics: See how to disable and enable Azure Data Factory triggers during deployment and how to use Key Vault secrets in Azure Data Factory.

6. Important deployment considerations

  • Configure Git integration on development factories; promote changes to test and production through CI/CD.
  • Keep the integration runtime type consistent across environments. For example, a self-hosted integration runtime should remain self-hosted in each environment.
  • Use the latest compatible Azure PowerShell modules and PowerShell Core for deployment scripts.
  • Validate linked templates and confirm that the release pipeline can access every referenced template file.
  • Review ARM parameter overrides carefully because build artifacts are generated at runtime.
  • Use approvals and checks for production stages.
  • Test trigger behavior, global parameters, managed private endpoints, and integration runtime dependencies in a non-production environment first.
  • Both the adf_publish branch workflow and the automated ADF Utilities workflow are supported. Choose the flow that fits your repository and release governance.

Conclusion

Automated Azure Data Factory publishing with Azure DevOps separates validation and ARM template generation from deployment. The build pipeline validates factory resources and produces a versioned artifact, while the release pipeline promotes that artifact across environments with controlled parameters, secrets, approvals, and trigger handling.

For the latest implementation details, see Microsoft’s documentation for automated publishing for CI/CD, Azure Pipelines releases, and pre- and post-deployment scripts.

Available on Microsoft Store

SSRS Reports Migration Wizard

A simple Windows tool for migrating SSRS reports, data sources, and related configurations between report servers.

See more

Visual Studio Marketplace

SSIS Catalog Migration Wizard

Extend Visual Studio with an easy way to migrate SSIS Catalog projects.

Kunal Rathi

With over 15 years of experience in data engineering and analytics, I've assisted countless clients in gaining valuable insights from their data. As a dedicated supporter of Data, Cloud and DevOps, I'm excited to connect with individuals who share my passion for this field. If my work resonates with you, we can talk and collaborate.