Using Azure Resource Manager Templates with Azure Data Factory

Azure Resource Manager, or ARM, “allows you to provision your applications using a declarative template.” So says the Azure Quickstart Templates page. ARM templates are JSON and allow administrators to import and export Azure resources using varying management patterns. I really like ARM templates for implementing infrastructure as code in Azure. In this post I show a very simple example of how to use ARM templates to export and then import a basic ADF (Azure Data Factory) pipeline.

Export an ADF Pipeline

To demonstrate, I created the Simplest ADF Pipeline Ever containing a single Wait activity configured to wait for 10 seconds. I named the pipeline “Wait Pipeline” and the Wait activity, “Wait 10 seconds.”

When the pipeline is open in the ADFv2 editor, click the dropdown labeled, “ARM Template” and then click “Export ARM Template”:

A zip file is downloaded. Decompress the file:

Delete the Pipeline

After exporting the ARM template, I deleted the original pipeline:

Import the Template

To import the template, click the ARM Template dropdown and click “Import ARM Template”:

On the Custom Deployment page, click the “Build your own template in the editor” link to open the template editor:

When the template editor opens, click the “Load file” button to load a template file:

Select an ARM template file to upload:

Note: The file – even the number of files – will change as the resource increases in complexity.

Save the template:

Configure the “Custom deployment” blade by selecting your Subscription, Resource group, and checking the
“I agree to the terms and conditions stated above” checkbox. Don’t let the “Purchase” button throw you, click Purchase to deploy the ARM template:

Once the ARM template is deployed, the resource(s) described therein – a very simple Azure Data Factory pipeline, in this case – is deployed and available:

Summer o’ ADF 2019 Edition

this post is part of a series titled the Summer o’ ADF, 2019 Edition! Click that link to see more posts and learn more about Azure Data Factory.

Andy Leonard

andyleonard.blog

Christian, husband, dad, grandpa, Data Philosopher, Data Engineer, SSIS and Biml guy. I was cloud before cloud was cool. :{>

7 thoughts on “Using Azure Resource Manager Templates with Azure Data Factory

  1. Hi,

    Is it possible to import just one pipeline using ARM templates into an existing ADF that contains multiple pipelines?

    Thanks in advance.

    1. Hey Matthew just adding something more to your question, as of now i dont think you can deploy individual resources through default arm template.
      I have simillar issues as you mentioned :
      Consider we have dev test and prod environment of ADF v2. The dev environment is git integrated. The developers have debuged their changes and merged with collaboration​ branch after pull request. The changes are published and deployed to test environment first. Here many features are getting tested but few are ready for prod and few are not, how do we move the ones which are ready since the arm template takes the entire factory?

      How do we hande this type of deployment scenario in Microsoft recommended CICD model of git/vsts integrated adf v2 through arm template

      One thing can be that the debug is itself your test environment for developers, however since we cant apply trigger testing in debug mode hence we do need a test environment. Also we can test in dev enviroment data factory mode but then we should stop continuos build and release trigger as we need to first test and then deploy manually.

  2. Hi
    I have 5 pipelines in my azure data factory which are live for now.
    I had exported ARM template, so now I am importing that ARM_Template, is there need to delete existing pipelines or should I change the name of that pipelines in exported json file to check file is importing in correct way or not?

  3. Why not go a step further and use powershell to import the template using:
    Connect-AzureRmAccount
    Select-AzureRmSubscription -SubscriptionId “here is the subscription identifier”
    Set-AzureRmDataFactoryV2Pipeline -ResourceGroupName “your resource group” -DataFactoryName “NameOfYourDataFactory” -Name “PipelineName” -File “C:\GitRoot\PipelineName.json”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.