How to use Global Parameters in Azure Data Factory?

We have demonstrated how to parameterize the database name in a Data Factory Linked Service, in a previous post. In that example, we created a parameter called ‘DB Name’ which was at the linked service level, i.e., it could be referenced only within that linked service.

However, there is a feature in Data Factory that allows you to create a parameter that can be referenced in multiple linked services/Pipelines across the Data Factory. These type of parameters are called Global Parameters.

The main advantage of using Global parameters in Data Factory is being able to dynamically pass the environment configuration values, to the underlying activities during deployment. E.g. (Passing the PROD Source/Sink connection strings, instead of the DEV/TEST Source/Sink connection strings, to the Copy Data activity). This feature saves considerable effort and time that would otherwise be required to update multiple linked services/pipelines, during deployment.  

  1. Create Global Parameters
Azure Data Factory : Global Parameters

To create a Global Parameter, we can go to Global Parameters under Author on the settings page in the Data Factory UI (shown above). This brings up a side-navigation UI element that allows the user to enter the Name, Type and value of the Global parameter. (see image below).

Azure Data Factory : Global Parameters side-nav

There is an option to edit an existing global parameter by clicking on the parameter name or by editing multiple parameters at once by clicking on the Edit All option.

Azure Data Factory : Edit Global Parameters
  1. Reference Global Parameters in a Data Factory Pipeline

Unlike other parameters in Data Factory, Global Parameters can be referenced in any activity or linked service within the Data Factory . Clicking on the parameter name under Global parameters (that we created in the previous step) will add an expression into the Add dynamic content textbox, that looks like this:

pipeline().globalParameters.<parameterName>

Global Parameters can also be added to the CI/CD (Continuous Integration/Continuous Deployment) solution integrated within Data Factory. We will discuss how to configure CI/CD for Azure Data Factory in detail, in a future post.

Reference: https://docs.microsoft.com/en-us/azure/data-factory/author-global-parameters

2 thoughts on “How to use Global Parameters in Azure Data Factory?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: