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
@@ -18,52 +18,59 @@ This article focuses on fundamental concepts and examples that help you create p
18
18
19
19
## Azure Data Factory UI and parameters
20
20
21
-
If you're new to Azure Data Factory parameter usage in the ADF user interface, review [Data Factory UI for linked services with parameters](./parameterize-linked-services.md#ui-experience) and [Data Factory UI for metadata driven pipeline with parameters](./how-to-use-trigger-parameterization.md#data-factory-ui) for a visual explanation.
21
+
You can find the parameter creation and assignment in the Azure Data Factory user interface (UI) for pipelines, datasets, and data flows.
22
22
23
-
## Parameter and expression concepts
23
+
1. In the [Azure Data Factory studio](https://adf.azure.com/), go to the **Authoring Canvas**and edit a pipeline, dataset, or data flow.
24
24
25
-
You can use parameters to pass external values into pipelines, datasets, linked services, and data flows. After you pass a parameter into a resource, you can't change it. When you parameterize resources, you can reuse them with different values each time. You can use parameters individually or as part of expressions. JSON values in the definition can be literal values or expressions that are evaluated at runtime.
25
+
1. Select the blank canvas to bring up pipeline settings. Don't select any activity. You might need to pull up the setting pane from the bottom of the canvas because it might be collapsed.
26
+
27
+
1. Select the **Parameters** tab and select **+ New** to add parameters.
28
+
29
+
:::image type="content" source="media/how-to-use-trigger-parameterization/01-create-parameter.png" alt-text="Screenshot that shows a pipeline setting showing how to define parameters in a pipeline.":::
30
+
31
+
You can also use parameters in linked services by selecting **Add dynamic content** next to the property you want to parameterize.
You can use parameters to pass external values into pipelines, datasets, linked services, and data flows. For example, if you have a dataset that accesses folders in Azure Blob Storage, you can parameterize the folder path so that you can reuse the same dataset to access different folders each time the pipeline is run.
38
+
39
+
Parameters are similar to variables, but they differ in that parameters are external and therefore *passed into* pipelines, datasets, linked services, and data flows, whereas variables are *defined and used within* a pipeline. Parameters are read-only, whereas variables can be modified within a pipeline by using the Set Variable activity.
40
+
41
+
You can use parameters by themselves, or as part of expressions. And the value of a parameter can be a literal value or an expression that is evaluated at runtime.
26
42
27
43
For example:
28
44
29
45
```json
30
46
"name": "value"
31
47
```
32
48
33
-
or
49
+
or
34
50
35
51
```json
36
52
"name": "@pipeline().parameters.password"
37
53
```
38
54
39
-
Expressions can appear anywhere in a JSON string value and always result in another JSON value. Here, *password* is a pipeline parameter in the expression. If a JSON value is an expression, the body of the expression is extracted by removing the at-sign (\@). If you need a literal string that starts with \@, you need to escape it by using \@\@. The following examples show how expressions are evaluated.
40
-
41
-
|JSON value|Result|
42
-
|----------------|------------|
43
-
|"parameters"|The characters 'parameters' are returned.|
44
-
|"parameters[1]"|The characters 'parameters[1]' are returned.|
45
-
|"\@\@"|A 1-character string that contains '\@' is returned.|
46
-
|" \@"|A 2-character string that contains ' \@' is returned.|
47
-
48
-
Expressions can also appear inside strings. This feature is called *string interpolation* where expressions are wrapped in `@{ ... }`. For example: `"name" : "First Name: @{pipeline().parameters.firstName} Last Name: @{pipeline().parameters.lastName}"`
55
+
## Expressions with parameters
56
+
57
+
Expressions are used to construct dynamic values in various parts of a pipeline, dataset, linked service, or data flow definition. Expressions always start with an at-sign (\@) followed by the expression body enclosed in parentheses. For example, the following expression uses the `concat` function to combine two strings:
49
58
50
-
When you use string interpolation, the result is always a string. Let's say you define `myNumber` as `42` and `myString` as `foo`:
59
+
`@concat('Hello, ', 'World!')`
60
+
61
+
When you reference parameters in expressions, you use the following syntax:
51
62
52
-
|JSON value|Result|
53
-
|----------------|------------|
54
-
|"\@pipeline().parameters.myString"| Returns `foo` as a string.|
55
-
|"\@{pipeline().parameters.myString}"| Returns `foo` as a string.|
56
-
|"\@pipeline().parameters.myNumber"| Returns `42` as a *number*.|
57
-
|"\@{pipeline().parameters.myNumber}"| Returns `42` as a *string*.|
58
-
|"Answer is: @{pipeline().parameters.myNumber}"| Returns the string `Answer is: 42`.|
59
-
|"\@concat('Answer is: ', string(pipeline().parameters.myNumber))"| Returns the string `Answer is: 42`|
60
-
|"Answer is: \@\@{pipeline().parameters.myNumber}"| Returns the string `Answer is: @{pipeline().parameters.myNumber}`.|
61
-
62
-
## Examples of parameters in expressions
63
+
`@pipeline().parameters.parameterName`
64
+
65
+
or
66
+
67
+
`@dataset().parameters.parameterName`
68
+
69
+
You can learn more about expressions in the [Expression language overview](control-flow-expression-language-overview.md) article, but here are some examples of using parameters in expressions.
63
70
64
71
### Complex expression example
65
72
66
-
The following example shows a complex example that references a deep sub-field of activity output. To reference a pipeline parameter that evaluates to a sub-field, use [] syntax instead of the dot(.) operator (as in the case of subfield1 and subfield2).
73
+
The following example references a deep sub-field of activity output. To reference a pipeline parameter that evaluates to a sub-field, use [] syntax instead of the dot(.) operator (as in the case of subfield1 and subfield2).
@@ -164,141 +171,6 @@ In the following example, the pipeline takes **inputPath** and **outputPath** pa
164
171
}
165
172
```
166
173
167
-
## Call functions within expressions
168
-
169
-
You can call functions within expressions. The following sections provide information about the functions that you can use in an expression.
170
-
171
-
### String functions
172
-
173
-
To work with strings, you can use these string functions and also some [collection functions](#collection-functions). String functions work only on strings.
174
-
175
-
| String function | Task |
176
-
| --------------- | ---- |
177
-
|[concat](control-flow-expression-language-functions.md#concat)| Combine two or more strings, and return the combined string. |
178
-
|[endsWith](control-flow-expression-language-functions.md#endswith)| Check whether a string ends with the specified substring. |
179
-
|[guid](control-flow-expression-language-functions.md#guid)| Generate a globally unique identifier (GUID) as a string. |
180
-
|[indexOf](control-flow-expression-language-functions.md#indexof)| Return the starting position for a substring. |
181
-
|[lastIndexOf](control-flow-expression-language-functions.md#lastindexof)| Return the starting position for the last occurrence of a substring. |
182
-
|[replace](control-flow-expression-language-functions.md#replace)| Replace a substring with the specified string, and return the updated string. |
183
-
|[split](control-flow-expression-language-functions.md#split)| Return an array that contains substrings, separated by commas, from a larger string based on a specified delimiter character in the original string. |
184
-
|[startsWith](control-flow-expression-language-functions.md#startswith)| Check whether a string starts with a specific substring. |
185
-
|[substring](control-flow-expression-language-functions.md#substring)| Return characters from a string, starting from the specified position. |
186
-
|[toLower](control-flow-expression-language-functions.md#toLower)| Return a string in lowercase format. |
187
-
|[toUpper](control-flow-expression-language-functions.md#toUpper)| Return a string in uppercase format. |
188
-
|[trim](control-flow-expression-language-functions.md#trim)| Remove leading and trailing whitespace from a string, and return the updated string. |
189
-
190
-
### Collection functions
191
-
192
-
To work with collections, generally arrays, strings, and sometimes dictionaries, you can use these collection functions.
193
-
194
-
| Collection function | Task |
195
-
| ------------------- | ---- |
196
-
|[contains](control-flow-expression-language-functions.md#contains)| Check whether a collection has a specific item. |
197
-
|[empty](control-flow-expression-language-functions.md#empty)| Check whether a collection is empty. |
198
-
|[first](control-flow-expression-language-functions.md#first)| Return the first item from a collection. |
199
-
|[intersection](control-flow-expression-language-functions.md#intersection)| Return a collection that has *only* the common items across the specified collections. |
200
-
|[join](control-flow-expression-language-functions.md#join)| Return a string that has *all* the items from an array, separated by the specified character. |
201
-
|[last](control-flow-expression-language-functions.md#last)| Return the last item from a collection. |
202
-
|[length](control-flow-expression-language-functions.md#length)| Return the number of items in a string or array. |
203
-
|[skip](control-flow-expression-language-functions.md#skip)| Remove items from the front of a collection, and return *all the other* items. |
204
-
|[take](control-flow-expression-language-functions.md#take)| Return items from the front of a collection. |
205
-
|[union](control-flow-expression-language-functions.md#union)| Return a collection that has *all* the items from the specified collections. |
206
-
207
-
### Logical functions
208
-
209
-
These functions are useful inside conditions. You can use them to evaluate any type of logic.
210
-
211
-
| Logical comparison function | Task |
212
-
| --------------------------- | ---- |
213
-
|[and](control-flow-expression-language-functions.md#and)| Check whether all expressions are true. |
214
-
|[equals](control-flow-expression-language-functions.md#equals)| Check whether both values are equivalent. |
215
-
|[greater](control-flow-expression-language-functions.md#greater)| Check whether the first value is greater than the second value. |
216
-
|[greaterOrEquals](control-flow-expression-language-functions.md#greaterOrEquals)| Check whether the first value is greater than or equal to the second value. |
217
-
|[if](control-flow-expression-language-functions.md#if)| Check whether an expression is true or false. Based on the result, return a specified value. |
218
-
|[less](control-flow-expression-language-functions.md#less)| Check whether the first value is less than the second value. |
219
-
|[lessOrEquals](control-flow-expression-language-functions.md#lessOrEquals)| Check whether the first value is less than or equal to the second value. |
220
-
|[not](control-flow-expression-language-functions.md#not)| Check whether an expression is false. |
221
-
|[or](control-flow-expression-language-functions.md#or)| Check whether at least one expression is true. |
222
-
223
-
### Conversion functions
224
-
225
-
You can use these functions to convert between each of the native types in the language:
226
-
227
-
- string
228
-
- integer
229
-
- float
230
-
- boolean
231
-
- arrays
232
-
- dictionaries
233
-
234
-
| Conversion function | Task |
235
-
| ------------------- | ---- |
236
-
|[array](control-flow-expression-language-functions.md#array)| Return an array from a single specified input. For multiple inputs, see [createArray](control-flow-expression-language-functions.md#createArray). |
237
-
|[base64](control-flow-expression-language-functions.md#base64)| Return the base64-encoded version for a string. |
238
-
|[base64ToBinary](control-flow-expression-language-functions.md#base64ToBinary)| Return the binary version for a base64-encoded string. |
239
-
|[base64ToString](control-flow-expression-language-functions.md#base64ToString)| Return the string version for a base64-encoded string. |
240
-
|[binary](control-flow-expression-language-functions.md#binary)| Return the binary version for an input value. |
241
-
|[bool](control-flow-expression-language-functions.md#bool)| Return the Boolean version for an input value. |
242
-
|[coalesce](control-flow-expression-language-functions.md#coalesce)| Return the first non-null value from one or more parameters. |
243
-
|[createArray](control-flow-expression-language-functions.md#createArray)| Return an array from multiple inputs. |
244
-
|[dataUri](control-flow-expression-language-functions.md#dataUri)| Return the data URI for an input value. |
245
-
|[dataUriToBinary](control-flow-expression-language-functions.md#dataUriToBinary)| Return the binary version for a data URI. |
246
-
|[dataUriToString](control-flow-expression-language-functions.md#dataUriToString)| Return the string version for a data URI. |
247
-
|[decodeBase64](control-flow-expression-language-functions.md#decodeBase64)| Return the string version for a base64-encoded string. |
248
-
|[decodeDataUri](control-flow-expression-language-functions.md#decodeDataUri)| Return the binary version for a data URI. |
249
-
|[decodeUriComponent](control-flow-expression-language-functions.md#decodeUriComponent)| Return a string that replaces escape characters with decoded versions. |
250
-
|[encodeUriComponent](control-flow-expression-language-functions.md#encodeUriComponent)| Return a string that replaces URL-unsafe characters with escape characters. |
251
-
|[float](control-flow-expression-language-functions.md#float)| Return a floating point number for an input value. |
252
-
|[int](control-flow-expression-language-functions.md#int)| Return the integer version for a string. |
253
-
|[json](control-flow-expression-language-functions.md#json)| Return the JavaScript Object Notation (JSON) type value or object for a string or XML. |
254
-
|[string](control-flow-expression-language-functions.md#string)| Return the string version for an input value. |
255
-
|[uriComponent](control-flow-expression-language-functions.md#uriComponent)| Return the URI-encoded version for an input value by replacing URL-unsafe characters with escape characters. |
256
-
|[uriComponentToBinary](control-flow-expression-language-functions.md#uriComponentToBinary)| Return the binary version for a URI-encoded string. |
257
-
|[uriComponentToString](control-flow-expression-language-functions.md#uriComponentToString)| Return the string version for a URI-encoded string. |
258
-
|[xml](control-flow-expression-language-functions.md#xml)| Return the XML version for a string. |
259
-
|[xpath](control-flow-expression-language-functions.md#xpath)| Check XML for nodes or values that match an XPath (XML Path Language) expression, and return the matching nodes or values. |
260
-
261
-
### Math functions
262
-
263
-
You can use these functions for either type of number: **integers** and **floats**.
264
-
265
-
| Math function | Task |
266
-
| ------------- | ---- |
267
-
|[add](control-flow-expression-language-functions.md#add)| Return the result from adding two numbers. |
268
-
|[div](control-flow-expression-language-functions.md#div)| Return the result from dividing two numbers. |
269
-
|[max](control-flow-expression-language-functions.md#max)| Return the highest value from a set of numbers or an array. |
270
-
|[min](control-flow-expression-language-functions.md#min)| Return the lowest value from a set of numbers or an array. |
271
-
|[mod](control-flow-expression-language-functions.md#mod)| Return the remainder from dividing two numbers. |
272
-
|[mul](control-flow-expression-language-functions.md#mul)| Return the product from multiplying two numbers. |
273
-
|[rand](control-flow-expression-language-functions.md#rand)| Return a random integer from a specified range. |
274
-
|[range](control-flow-expression-language-functions.md#range)| Return an integer array that starts from a specified integer. |
275
-
|[sub](control-flow-expression-language-functions.md#sub)| Return the result from subtracting the second number from the first number. |
276
-
277
-
### Date functions
278
-
279
-
| Date or time function | Task |
280
-
| --------------------- | ---- |
281
-
|[addDays](control-flow-expression-language-functions.md#addDays)| Add a number of days to a timestamp. |
282
-
|[addHours](control-flow-expression-language-functions.md#addHours)| Add a number of hours to a timestamp. |
283
-
|[addMinutes](control-flow-expression-language-functions.md#addMinutes)| Add a number of minutes to a timestamp. |
284
-
|[addSeconds](control-flow-expression-language-functions.md#addSeconds)| Add a number of seconds to a timestamp. |
285
-
|[addToTime](control-flow-expression-language-functions.md#addToTime)| Add a number of time units to a timestamp. See also [getFutureTime](control-flow-expression-language-functions.md#getFutureTime). |
286
-
|[convertFromUtc](control-flow-expression-language-functions.md#convertFromUtc)| Convert a timestamp from Universal Time Coordinated (UTC) to the target time zone. |
287
-
|[convertTimeZone](control-flow-expression-language-functions.md#convertTimeZone)| Convert a timestamp from the source time zone to the target time zone. |
288
-
|[convertToUtc](control-flow-expression-language-functions.md#convertToUtc)| Convert a timestamp from the source time zone to Universal Time Coordinated (UTC). |
289
-
|[dayOfMonth](control-flow-expression-language-functions.md#dayOfMonth)| Return the day of the month component from a timestamp. |
290
-
|[dayOfWeek](control-flow-expression-language-functions.md#dayOfWeek)| Return the day of the week component from a timestamp. |
291
-
|[dayOfYear](control-flow-expression-language-functions.md#dayOfYear)| Return the day of the year component from a timestamp. |
292
-
|[formatDateTime](control-flow-expression-language-functions.md#formatDateTime)| Return the timestamp as a string in optional format. |
293
-
|[getFutureTime](control-flow-expression-language-functions.md#getFutureTime)| Return the current timestamp plus the specified time units. See also [addToTime](control-flow-expression-language-functions.md#addToTime). |
294
-
|[getPastTime](control-flow-expression-language-functions.md#getPastTime)| Return the current timestamp minus the specified time units. See also [subtractFromTime](control-flow-expression-language-functions.md#subtractFromTime). |
295
-
|[startOfDay](control-flow-expression-language-functions.md#startOfDay)| Return the start of the day for a timestamp. |
296
-
|[startOfHour](control-flow-expression-language-functions.md#startOfHour)| Return the start of the hour for a timestamp. |
297
-
|[startOfMonth](control-flow-expression-language-functions.md#startOfMonth)| Return the start of the month for a timestamp. |
298
-
|[subtractFromTime](control-flow-expression-language-functions.md#subtractFromTime)| Subtract a number of time units from a timestamp. See also [getPastTime](control-flow-expression-language-functions.md#getPastTime). |
299
-
|[ticks](control-flow-expression-language-functions.md#ticks)| Return the `ticks` property value for a specified timestamp. |
300
-
|[utcNow](control-flow-expression-language-functions.md#utcNow)| Return the current timestamp as a string. |
301
-
302
174
## Detailed examples for practice
303
175
304
176
### Azure Data Factory copy pipeline with parameters
0 commit comments