Skip to content

Commit b7d7be0

Browse files
committed
update the arm lambda article
1 parent 8632ac1 commit b7d7be0

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

articles/azure-resource-manager/templates/template-functions-lambda.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ ms.date: 02/09/2023
99

1010
# Lambda functions for ARM templates
1111

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:
13+
14+
```bicep
15+
lambda(<lambda variable>, [<lambda variable>, ...], <expression>)
16+
```
17+
1318

1419
> [!TIP]
1520
> 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:
2530

2631
## filter
2732

28-
`filter(inputArray, lambda expression)`
33+
`filter(inputArray, lambda function)`
2934

3035
Filters an array with a custom filtering function.
3136

@@ -36,7 +41,7 @@ In Bicep, use the [filter](../bicep/bicep-functions-lambda.md#filter) function.
3641
| Parameter | Required | Type | Description |
3742
|:--- |:--- |:--- |:--- |
3843
| 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.|
4045

4146
### Return value
4247

@@ -137,7 +142,7 @@ The output from the preceding example:
137142

138143
## map
139144

140-
`map(inputArray, lambda expression)`
145+
`map(inputArray, lambda function)`
141146

142147
Applies a custom mapping function to each element of an array.
143148

@@ -148,7 +153,7 @@ In Bicep, use the [map](../bicep/bicep-functions-lambda.md#map) function.
148153
| Parameter | Required | Type | Description |
149154
|:--- |:--- |:--- |:--- |
150155
| 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.|
152157

153158
### Return value
154159

@@ -225,7 +230,7 @@ The output from the preceding example is:
225230

226231
## reduce
227232

228-
`reduce(inputArray, initialValue, lambda expression)`
233+
`reduce(inputArray, initialValue, lambda function)`
229234

230235
Reduces an array with a custom reduce function.
231236

@@ -237,7 +242,7 @@ In Bicep, use the [reduce](../bicep/bicep-functions-lambda.md#reduce) function.
237242
|:--- |:--- |:--- |:--- |
238243
| inputArray |Yes |array |The array to reduce.|
239244
| 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.|
241246

242247
### Return value
243248

@@ -332,7 +337,7 @@ The [union](./template-functions-object.md#union) function returns a single obje
332337

333338
## sort
334339

335-
`sort(inputArray, lambda expression)`
340+
`sort(inputArray, lambda function)`
336341

337342
Sorts an array with a custom sort function.
338343

@@ -343,7 +348,7 @@ In Bicep, use the [sort](../bicep/bicep-functions-lambda.md#sort) function.
343348
| Parameter | Required | Type | Description |
344349
|:--- |:--- |:--- |:--- |
345350
| 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.|
347352

348353
### Return value
349354

@@ -408,7 +413,7 @@ The output from the preceding example sorts the dog objects from the youngest to
408413

409414
## toObject
410415

411-
`toObject(inputArray, lambda expression, [lambda expression])`
416+
`toObject(inputArray, lambda function, [lambda function])`
412417

413418
Converts an array to an object with a custom key function and optional custom value function.
414419

@@ -419,8 +424,8 @@ In Bicep, use the [toObject](../templates/template-functions-lambda.md#toobject)
419424
| Parameter | Required | Type | Description |
420425
|:--- |:--- |:--- |:--- |
421426
| inputArray |Yes |array |The array used for creating an object.|
422-
| lambda expression |Yes |expression |The lambda expression used to provide the key predicate.|
423-
| lambda expression |No |expression |The lambda expression used to provide the value predicate.|
427+
| lambda function |Yes |expression |The lambda function used to provide the key predicate.|
428+
| lambda function |No |expression |The lambda function used to provide the value predicate.|
424429

425430
### Return value
426431

0 commit comments

Comments
 (0)