You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article helps you understand the difference between pipeline parameters and variables in Azure Data Factory and Azure Synapse Analytics and how to use them to control your pipeline.
18
+
This article helps you understand the difference between pipeline parameters and variables in Azure Data Factory and Azure Synapse Analytics and how to use them to control your pipeline behavior.
19
19
20
20
## Pipeline parameters
21
21
22
-
Parameters are defined for the whole pipeline, and are constant during a pipeline run. You can read them during a pipeline run but you are unable to modify them.
22
+
Parameters are defined at the pipeline level, and cannot be modified during a pipeline run. Pipeline parameters can be used to control the behavior of a pipeline and its activities, such as by passing in the connection details for a dataset or the path of a file to be processed.
23
23
24
-
### Define a parameter
24
+
### How to define a pipeline parameter
25
25
26
-
To define a pipeline parameter click on your pipeline to view the pipeline configuration tabs. Select the "Parameters" tab and click on "+ New" to define a new parameter.
27
-
Parameters can be of type String, Int, Float, Bool, Array, Object or SecureString. In this tab, you can also assign a default value to your parameter.
26
+
To define a pipeline parameter, follow these steps:
28
27
29
-

28
+
- Click on your pipeline to view its configuration tabs.
29
+
- Select the "Parameters" tab, and click on the "+ New" button to define a new parameter.
30
+
- Enter a name and description for the parameter, and select its data type from the dropdown menu. Data types can be String, Int, Float, Bool, Array, Object, or SecureString.
31
+
- Optionally, you can also assign a default value to the parameter.
30
32
31
-
Before each pipeline run there will be a right panel where you can assign a new value to your parameter, otherwise the pipeline will take the default value previously defined.
33
+
After defining a pipeline parameter, you can access its value during a pipeline run by using the ```@pipeline().parameters.<parameter name>``` expression in a pipeline activity. For example, if you defined a parameter called account_name of type String, you can access its value in an activity by using the expression ```@pipeline().parameters.account_name```.
32
34
33
-
### Access a parameter value
35
+

34
36
35
-
To access a parameter value use the ```@pipeline().parameters.<parameter name>``` expression.
37
+
Before each pipeline run, you can assign a new value to your parameter in the right panel, otherwise the pipeline will use the default or the value previously defined.
36
38
37
39
## Pipeline variables
38
40
39
-
Pipeline variables can be set at the start of a pipeline, read and modified during a pipeline run through a [Set Variable](control-flow-set-variable-activity.md) activity.
41
+
Pipeline variables are values that can be set and modified during a pipeline run. Unlike pipeline parameters, which are defined at the pipeline level and cannot be changed during a pipeline run, pipeline variables can be set and modified within a pipeline using a [Set Variable](control-flow-set-variable-activity.md) activity.
42
+
43
+
Pipeline variables can be used to store and manipulate data during a pipeline run, such as by storing the results of a computation or the current state of a process.
40
44
41
45
> [!NOTE]
42
46
> Variables are currently scoped at the pipeline level. This means that they are not thread safe and can cause unexpected and undesired behavior if they are accessed from within a parallel iteration activity such as a foreach loop, especially when the value is also being modified within that foreach activity.
43
-
### Define a variable
44
47
45
-
To define a pipeline variable click on your pipeline to view the pipeline configuration tabs. Select the "Variables" tab and click on "+ New" to define a new variable.
46
-
Parameters can be of type String, Bool or Array. In this tab, you can also assign a default value to your variable that it will be used as initial value at the start of a pipeline run.
48
+
To define a pipeline variable, follow these steps:
47
49
48
-

50
+
- Click on your pipeline to view its configuration tabs.
49
51
50
-
### Access a variable value
52
+
- Select the "Variables" tab, and click on the "+ New" button to define a new variable.
51
53
52
-
To access a variable value use the ```@variables('<variable name>')``` expression.
54
+
- Enter a name and description for the variable, and select its data type from the dropdown menu. Data types can be String, Bool, or Array.
55
+
56
+
- Optionally, you can also assign a default value to the variable. This value will be used as the initial value of the variable at the start of a pipeline run.
57
+
58
+
After defining a pipeline variable, you can access its value during a pipeline run by using the ```@variables('<variable name>')``` expression in a pipeline activity. For example, if you defined a variable called flag of type Array, you can access its value in an activity by using the expression ```@variables('flag')```. You can also use a "Set Variable" activity to modify the value of the variable within a pipeline.
59
+
60
+

53
61
54
62
## Next steps
55
63
See the following tutorials for step-by-step instructions for creating pipelines with activities:
0 commit comments