Deploying ADF Using ARM Templates
How to publish Azure Data Factory pipelines across environments using ARM templates and Azure DevOps — with parameterisation for DEV, TST, and PRD.
You’ve set up your Azure Data Factory (ADF) in one environment, but now you want to replicate it in other environments. That’s where ARM templates come into the mix.
In this post, we’ll cover what ARM templates are, how they work for ADF, customization options, and how to deploy them.
What is an ARM template?
An Azure Resource Manager (ARM) template is a JSON file that defines the infrastructure and configuration of Azure resources. The JSON file follows a declarative approach, meaning you describe what resources should be created and what their properties are, but not the commands to create them.
For Azure Data Factory, an ARM template can define:
- Pipelines
- Datasets
- Linked services
- Triggers
- Integration runtimes
- Data flows
- …
As an added bonus, ARM templates allow you to specify variables, which means that if you have an ADF for a DEV, TST, PRD environment, you can easily change some options between environments.
The base case
Let’s start with a simple scenario where we want to duplicate an ADF instance from DEV to TST/PRD without any changes.
I’ve created a simple ADF, that will act as the DEV environement. It has one simple pipeline, that copies some data from the pokeapi to a blob storage:

The first step is to link ADF to an Azure DevOps repository. Once this is done, every time we click “publish,” ADF will automatically save the ARM template in the “adf_publish” branch of the repository. (After setting up Git integration, click publish to trigger the process for the first time.)

At this point, you’ll notice that the repository contains a template file and a parameters file. The parameters file is used to fill in specific values in the template, such as the data factory ID, which is based on the factoryName. Later, we’ll see how to configure which variables should be parameterized.

Deployment Pipeline Setup
Now, let’s create a pipeline to deploy this configuration to the TST environment. In the repository linked to your ADF instance, create a new file named “deployment.yaml” in the adf_branch.
trigger:
- adf_publish
steps:
- task: AzureResourceManagerTemplateDeployment@3
displayName: "ARM Template deployment to the TST environment"
inputs:
# which connection to use
azureResourceManagerConnection: 'mi-blob-adf-deployment'
# where to deploy to
subscriptionId: 'XXXXXXXX-1074-4ad4-XXXXXX'
resourceGroupName: 'blog-adf-deployment-tst'
location: 'West Europe'
# what to deploy
csmFile: '$(Build.SourcesDirectory)/blog-adf-deployment-dev/ARMTemplateForFactory.json'
csmParametersFile: '$(Build.SourcesDirectory)/blog-adf-deployment-dev/ARMTemplateParametersForFactory.json'
overrideParameters: > # Use this to avoid newline characters in multiline string
-factoryName "blog-ADF-deployment-tst"
We need to fill in 7 parameters:
- azureResourceManagerConnection: The name of the service connection used to deploy the template. I chose for a managed identity that has “Owner” rights on the DEV, TST, PRD subscription.This connection was added to Azure DevOps via Settings (bottom left) > Pipelines — Service connections > New service connection. You can also use app registrations (via a client secret our federated credential).

- subscriptionId, resourceGroupName, location: The details of the TST environment
- csmFile, csmParamtersFile: Locations of the ARM template and its parameters file. $(Build.SourcesDirectory) is the path on the agent where your files are downloaded.
- overrideParameters: In the parameters file, variables have predefined default values, but we can override them when necessary. In this case, we need to override the name of the Data Factory. (By default, the ARM template deploys at the resource group level rather than targeting a specific resource. This is why we didn’t need to specify the ADF name in the “where to deploy” section. However, the default value for the Data Factory name in the template corresponds to the DEV environment. If we don’t override this, the ARM template will attempt to find a Data Factory with the DEV name in the specified subscription and resource group, which would be incorrect.)
Now, in the Pipelines section add a new pipeline. Choose “Azure Repos Git” > The Azure Repo linked to ADF > “Existing Pipeline” and pick deployment.yaml.
If you run the pipeline now, the DEV ADF configuration will be copied over to your TST ADF.

Adding extra parameters
Now, let’s say we need to adjust some parameters between environments. For example, in the DEV environment, we retrieve data from:
- Absolute URL: https://pokeapi.co/api/v2/pokemon/
- Relative URL: ditto
But in TST I want the info of bulbasaur instead of ditto. Let’s first check if ADF already made a parameter for the relative URL.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"factoryName": {
"value": "blog-adf-deployment-dev"
},
"AzureBlobStorage1_connectionString": {
"value": ""
},
"HttpServer1_properties_typeProperties_url": {
"value": "https://pokeapi.co/api/v2/pokemon/"
}
}
}
No, the relative URL is not parameterized—only the absolute URL is. So let’s open up our DEV ADF. Go to “manage” and “Edit parameter configuration” under “ARM template”.

But what do we need to change? Well, for that take a look at the template JSON file, there we have an object of type dataset, and under typeproperties > location is the relative URL.

To parameterize this:
- Add the property path (in this case, location > relativeUrl) under the relevant entity type (in this case, dataset).
- Assign an action to the path:
- = → Retains the current value as the default for the parameter.
-
- → Does not keep a default value for the parameter.
So in our case, we add:

Save this template, and republish your ADF. The template now has an extra line web_json_properties_typeProperties_location_relativeUrl:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"factoryName": {
"value": "blog-adf-deployment-dev"
},
"AzureBlobStorage1_connectionString": {
"value": ""
},
"web_json_properties_typeProperties_location_relativeUrl": {
"value": "ditto"
},
"HttpServer1_properties_typeProperties_url": {
"value": "https://pokeapi.co/api/v2/pokemon/"
}
}
}
We can now add it under overrideParameters to choose a different relative URL for TST.
csmParametersFile: '$(Build.SourcesDirectory)/blog-adf-deployment-dev/ARMTemplateParametersForFactory.json'
overrideParameters: > # Use this to avoid newline characters in multiline string
-factoryName "blog-ADF-deployment-tst"
-web_json_properties_typeProperties_location_relativeUrl "bulbasaur"