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.
- Create 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).
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.
- 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:
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.
2 thoughts on “How to use Global Parameters in Azure Data Factory?”