Variables and Parameters in Azure Data Factory?

Viewed 17890

Im just learning ADF, can you explain to me the difference between Variables and Parameters? I cant find a good explanation about it.

3 Answers

Parameters are set for the whole pipeline, and are constant during a pipeline run. You can read them during a run to control what the pipeline does. They are like constants in a programming language, defined at the top of the source code.

Variables can be set at the start of a pipeline and read and modified during a run. They are like normal variables in a programming language.

Parameters are something that can be set to model (dataset, pipeline, etc) at runtime. Without parameters, you model is fixed, for example, without parameters you can only write query like "select * from order where timestamp > '11/01/2018'" in dataset, with parameter 'TS' you can write query like "select * from order where timestamp > '@dataset.TS'" so that your activity run will query and copy data in different time window.

Variables are something that contain real value at runtime and can be assigned to those parameters in app model(dataset, pipeline, etc) to get real things done.

Here are some examples:

https://docs.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions#examples

A variable can be used as a parameter (input). A constant can also be used as a parameter. Being a parameter is being used.

Related