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/bicep/bicep-functions.md
+27-12Lines changed: 27 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Bicep functions
3
3
description: Describes the functions to use in a Bicep file to retrieve values, work with strings and numerics, and retrieve deployment information.
4
4
ms.topic: conceptual
5
-
ms.date: 09/09/2021
5
+
ms.date: 09/30/2021
6
6
---
7
7
8
8
# Bicep functions
@@ -11,13 +11,28 @@ This article describes all the functions you can use in a Bicep file. For a desc
11
11
12
12
Most functions work the same when deployed to a resource group, subscription, management group, or tenant. A few functions can't be used in all scopes. They're noted in the lists below.
13
13
14
+
## Namespaces for functions
15
+
16
+
All Bicep functions are contained within two namespaces - `az` and `sys`. Typically, you don't need to specify the namespace when you use the function. You specify the namespace only when the function name is the same as another item you've defined in the Bicep file. For example, if you create a parameter named `range`, you need to differentiate the `range` function by adding the `sys` namespace.
17
+
18
+
```bicep
19
+
// Parameter contains the same name as a function
20
+
param range int
21
+
22
+
// Must use sys namespace to call the function.
23
+
// The second use of range refers to the parameter.
24
+
output result array = sys.range(1, range)
25
+
```
26
+
27
+
The `az` namespace contains functions that are specific to an Azure deployment. The `sys` namespace contains functions that are used to construct values. The `sys` namespace also includes decorators for parameters and resource loops. The namespaces are noted in this article.
28
+
14
29
## Any function
15
30
16
-
The [any function](./bicep-functions-any.md) is available in Bicep to help resolve issues around data type warnings.
31
+
The [any function](./bicep-functions-any.md) is available in Bicep to help resolve issues around data type warnings. This function is in the `sys` namespace.
17
32
18
33
## Array functions
19
34
20
-
The following functions are available for working with arrays.
35
+
The following functions are available for working with arrays. All of these functions are in the `sys` namespace.
21
36
22
37
*[array](./bicep-functions-array.md#array)
23
38
*[concat](./bicep-functions-array.md#concat)
@@ -36,42 +51,42 @@ The following functions are available for working with arrays.
36
51
37
52
## Date functions
38
53
39
-
The following functions are available for working with dates.
54
+
The following functions are available for working with dates. All of these functions are in the `sys` namespace.
The following functions are available for loading the content from external files into your Bicep file.
68
+
The following functions are available for loading the content from external files into your Bicep file. All of these functions are in the `sys` namespace.
The following function is available for working with logical conditions:
75
+
The following function is available for working with logical conditions. This function is in the `sys` namespace.
61
76
62
77
*[bool](./bicep-functions-logical.md#bool)
63
78
64
79
## Numeric functions
65
80
66
-
The following functions are available for working with integers:
81
+
The following functions are available for working with integers. All of these functions are in the `sys` namespace.
67
82
68
83
*[int](./bicep-functions-numeric.md#int)
69
84
*[min](./bicep-functions-numeric.md#min)
70
85
*[max](./bicep-functions-numeric.md#max)
71
86
72
87
## Object functions
73
88
74
-
The following functions are available for working with objects.
89
+
The following functions are available for working with objects. All of these functions are in the `sys` namespace.
75
90
76
91
*[contains](./bicep-functions-object.md#contains)
77
92
*[empty](./bicep-functions-object.md#empty)
@@ -82,7 +97,7 @@ The following functions are available for working with objects.
82
97
83
98
## Resource functions
84
99
85
-
The following functions are available for getting resource values:
100
+
The following functions are available for getting resource values. Most of these functions are in the `az` namespace. The list functions and the getSecret function are called directly on the resource type, so they don't have a namespace qualifier.
0 commit comments