Skip to content

Commit cf7bf0a

Browse files
authored
Merge pull request #220996 from soferreira/patch-11
update concepts
2 parents 029b439 + c8d7779 commit cf7bf0a

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

articles/data-factory/concepts-parameters-variables.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,48 +8,56 @@ ms.service: data-factory
88
ms.subservice: orchestration
99
ms.custom: synapse
1010
ms.topic: conceptual
11-
ms.date: 09/13/2022
11+
ms.date: 12/08/2022
1212
---
1313

1414
# Pipeline parameters and variables in Azure Data Factory and Azure Synapse Analytics
1515

1616
[!INCLUDE[appliesto-adf-asa-md](includes/appliesto-adf-asa-md.md)]
1717

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.
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.
1919

2020
## Pipeline parameters
2121

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.
2323

24-
### Define a parameter
24+
### How to define a pipeline parameter
2525

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:
2827

29-
![Screenshot of parameter definition.](./media/pipeline-parameter-variable-definition/parameter-definition.png)
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.
3032

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```.
3234

33-
### Access a parameter value
35+
![Screenshot of parameter definition.](./media/pipeline-parameter-variable-definition/parameter-definition.png)
3436

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.
3638

3739
## Pipeline variables
3840

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.
4044

4145
> [!NOTE]
4246
> 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
4447
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:
4749

48-
![Screenshot of variable definition.](./media/pipeline-parameter-variable-definition/variable-definition.png)
50+
- Click on your pipeline to view its configuration tabs.
4951

50-
### Access a variable value
52+
- Select the "Variables" tab, and click on the "+ New" button to define a new variable.
5153

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+
![Screenshot of variable definition.](./media/pipeline-parameter-variable-definition/variable-definition.png)
5361

5462
## Next steps
5563
See the following tutorials for step-by-step instructions for creating pipelines with activities:

0 commit comments

Comments
 (0)