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
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/templates/template-functions-lambda.md
+17-12Lines changed: 17 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,12 @@ ms.date: 02/09/2023
9
9
10
10
# Lambda functions for ARM templates
11
11
12
-
This article describes the lambda functions to use in ARM templates. [Lambda functions](/dotnet/csharp/language-reference/operators/lambda-expressions) are essentially blocks of code that can be passed as an argument. They can take multiple parameters, but are restricted to a single line of code.
12
+
This article describes the lambda functions to use in ARM templates. [Lambda functions](/dotnet/csharp/language-reference/operators/lambda-expressions) are essentially blocks of code that can be passed as an argument. They can take multiple parameters, but are restricted to a single line of code. In Bicep, lambda expression is in this format:
> We recommend [Bicep](../bicep/overview.md) because it offers the same capabilities as ARM templates and the syntax is easier to use. To learn more, see [deployment](../bicep/bicep-functions-deployment.md) functions.
@@ -25,7 +30,7 @@ ARM template lambda function has these limitations:
25
30
26
31
## filter
27
32
28
-
`filter(inputArray, lambda expression)`
33
+
`filter(inputArray, lambda function)`
29
34
30
35
Filters an array with a custom filtering function.
31
36
@@ -36,7 +41,7 @@ In Bicep, use the [filter](../bicep/bicep-functions-lambda.md#filter) function.
36
41
| Parameter | Required | Type | Description |
37
42
|:--- |:--- |:--- |:--- |
38
43
| inputArray |Yes |array |The array to filter.|
39
-
| lambda expression|Yes |expression |The lambda expression applied to each input array element. If false, the item will be filtered out of the output array.|
44
+
| lambda function|Yes |expression |The lambda function applied to each input array element. If false, the item will be filtered out of the output array.|
40
45
41
46
### Return value
42
47
@@ -137,7 +142,7 @@ The output from the preceding example:
137
142
138
143
## map
139
144
140
-
`map(inputArray, lambda expression)`
145
+
`map(inputArray, lambda function)`
141
146
142
147
Applies a custom mapping function to each element of an array.
143
148
@@ -148,7 +153,7 @@ In Bicep, use the [map](../bicep/bicep-functions-lambda.md#map) function.
148
153
| Parameter | Required | Type | Description |
149
154
|:--- |:--- |:--- |:--- |
150
155
| inputArray |Yes |array |The array to map.|
151
-
| lambda expression|Yes |expression |The lambda expression applied to each input array element, in order to generate the output array.|
156
+
| lambda function|Yes |expression |The lambda function applied to each input array element, in order to generate the output array.|
152
157
153
158
### Return value
154
159
@@ -225,7 +230,7 @@ The output from the preceding example is:
@@ -237,7 +242,7 @@ In Bicep, use the [reduce](../bicep/bicep-functions-lambda.md#reduce) function.
237
242
|:--- |:--- |:--- |:--- |
238
243
| inputArray |Yes |array |The array to reduce.|
239
244
| initialValue |No |any |Initial value.|
240
-
| lambda expression|Yes |expression |The lambda expression used to aggregate the current value and the next value.|
245
+
| lambda function|Yes |expression |The lambda function used to aggregate the current value and the next value.|
241
246
242
247
### Return value
243
248
@@ -332,7 +337,7 @@ The [union](./template-functions-object.md#union) function returns a single obje
332
337
333
338
## sort
334
339
335
-
`sort(inputArray, lambda expression)`
340
+
`sort(inputArray, lambda function)`
336
341
337
342
Sorts an array with a custom sort function.
338
343
@@ -343,7 +348,7 @@ In Bicep, use the [sort](../bicep/bicep-functions-lambda.md#sort) function.
343
348
| Parameter | Required | Type | Description |
344
349
|:--- |:--- |:--- |:--- |
345
350
| inputArray |Yes |array |The array to sort.|
346
-
| lambda expression|Yes |expression |The lambda expression used to compare two array elements for ordering. If true, the second element will be ordered after the first in the output array.|
351
+
| lambda function|Yes |expression |The lambda function used to compare two array elements for ordering. If true, the second element will be ordered after the first in the output array.|
347
352
348
353
### Return value
349
354
@@ -408,7 +413,7 @@ The output from the preceding example sorts the dog objects from the youngest to
0 commit comments