Parameters:
- Purpose: Parameters are values you pass into a pipeline at the start of execution. They remain constant during the pipeline's runtime and cannot be changed after the execution begins.
- Scope: They are pipeline-scoped, meaning they can be accessed throughout the pipeline but are set only once, when the pipeline is triggered.
- Use Case: Think of parameters as inputs to a pipeline that determine how it will behave. For example, you might pass the file name or a date range as parameters to a pipeline. Example:A pipeline that copies data from a file in Blob Storage. The file name is passed as a parameter, so different file names can be used each time the pipeline is triggered.
"parameters": { "fileName": { "type": "string", "defaultValue": "defaultFileName.csv" } }
Variables:
- Purpose: Variables store values that can change during the pipeline's runtime. You can set or modify the value of a variable within different activities in the pipeline.
- Scope: Variables are also pipeline-scoped but can be updated at different points in the pipeline execution.
- Use Case: Think of variables as values that might change during pipeline execution. For example, you might want to track the status of a loop or dynamically update a value during runtime. Example:
- A pipeline that processes multiple files. You can use a variable to keep track of which file is being processed in a loop.
"variables": { "currentFile": { "type": "string", "defaultValue": "" } }
Key Difference:
- Parameters: Set once at the start of the pipeline and remain constant.
- Variables: Can be changed during the pipeline’s execution.
Useful Links:
These resources provide step-by-step guides to help you work with parameters and variables in ADF.