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/data-types.md
+49-13Lines changed: 49 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,25 +3,13 @@ title: Data types in Bicep
3
3
description: This article describes the data types that are available in Bicep.
4
4
ms.topic: reference
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 08/20/2024
6
+
ms.date: 11/12/2024
7
7
---
8
8
9
9
# Data types in Bicep
10
10
11
11
This article describes the data types that are supported in [Bicep](./overview.md). To define custom data types, see [User-defined data types](./user-defined-data-types.md).
12
12
13
-
## Supported types
14
-
15
-
Within Bicep, you can use these data types:
16
-
17
-
*[array](#arrays)
18
-
*[bool](#booleans)
19
-
*[int](#integers)
20
-
*[object](#objects)
21
-
*[secureObject (indicated by a decorator in Bicep](#secure-strings-and-objects))
22
-
*[secureString (indicated by a decorator in Bicep](#secure-strings-and-objects))
23
-
*[string](#strings)
24
-
25
13
## Arrays
26
14
27
15
Arrays start with a left bracket (`[`) and end with a right bracket (`]`). In Bicep, you can declare an array in a single line or in multiple lines. Commas (`,`) are used between values in single-line declarations, but they aren't used in multiple-line declarations. You can mix and match single-line and multiple-line declarations. The multiple-line declaration requires [Bicep CLI version 0.7.X or higher](./install.md).
* Use [Comparison operators](./operators-comparison.md) to compare two arrays.
80
+
* Use [Index accessor](./operators-access.md#index-accessor) to get an element from an array.
81
+
* Use [Safe-dereference operator](./operator-safe-dereference.md) to access elements of an array.
82
+
* Use [Spread](./operator-spread.md) to merge arrays.
83
+
84
+
### Array-related functions
85
+
86
+
* See [Array functions](./bicep-functions-array.md).
87
+
* See [Lambda functions](./bicep-functions-lambda.md).
88
+
89
89
## Booleans
90
90
91
91
When you specify Boolean values, use `true` or `false`. Don't surround the value with quotation marks.
@@ -94,6 +94,15 @@ When you specify Boolean values, use `true` or `false`. Don't surround the value
94
94
param exampleBool bool = true
95
95
```
96
96
97
+
## Boolean-related operators
98
+
99
+
* Use [Comparison operators](./operators-comparison.md) to compare boolean values.
100
+
* See [Logical operators](./operators-logical.md).
101
+
102
+
## Boolean-related functions
103
+
104
+
See [Logical function](./bicep-functions-logical.md)
105
+
97
106
## Integers
98
107
99
108
When you specify integer values, don't use quotation marks.
@@ -129,6 +138,15 @@ output bar 1 | 2 | 3 = 3
129
138
130
139
Floating point, decimal, or binary formats aren't currently supported.
131
140
141
+
### Integer-related operators
142
+
143
+
* See [Comparison operators](./operators-comparison.md).
144
+
* See [Numeric operators](./operators-numeric.md).
145
+
146
+
### Integer-related functions
147
+
148
+
See [Numeric functions](./bicep-functions-numeric.md).
149
+
132
150
## Objects
133
151
134
152
Objects start with a left brace (`{`) and end with a right brace (`}`). In Bicep, you can declare an object in a single line or in multiple lines. Each property in an object consists of a key and a value. The key and value are separated by a colon (`:`). An object allows any property of any type. Commas (`,`) are used between properties for single-line declarations, but they aren't used between properties for multiple-line declarations. You can mix and match single-line and multiple-line declarations. The multiple-line declaration requires [Bicep CLI version 0.7.X or higher](./install.md).
output bar bool = contains(objectToTest, 'four') && objectToTest.four == 4
218
236
```
219
237
238
+
### Object-related operators
239
+
240
+
* Use [Comparison operators](./operators-comparison.md) to compare objects.
241
+
* Use [Index accessor](./operators-access.md#index-accessor) to get a property from an object.
242
+
* Use [Safe-dereference operator](./operator-safe-dereference.md) to access object members.
243
+
* Use [Spread](./operator-spread.md) to merge objects.
244
+
245
+
### Object-related functions
246
+
247
+
See [Object functions](./bicep-functions-object.md).
248
+
220
249
## Strings
221
250
222
251
In Bicep, strings are marked with single quotation marks, and you must declare them on a single line. All Unicode characters with code points between `0` and `10FFFF` are allowed.
@@ -317,6 +346,13 @@ var myVar6 = '''interpolation
317
346
is ${blocked}'''
318
347
```
319
348
349
+
### String-related operators
350
+
351
+
* See [Comparison operators](./operators-comparison.md).
352
+
353
+
### String-related functions
354
+
355
+
320
356
## Union types
321
357
322
358
In Bicep, a union type allows the creation of a combined type that consists of a set of subtypes. An assignment is valid if any of the individual subtype assignments are permitted. The `|` character separates individual subtypes that use an `or` condition. For example, the syntax `a | b` means that a valid assignment could be either `a` or `b`. Union types are translated into the [allowed-value](../templates/definitions.md#allowed-values) constraint in Bicep, so only literals are permitted as members. Unions can include any number of literal-typed expressions.
The spread operation can be used to avoid setting an optional property. In the following example, _accessTier_ is set only if the parameter _tier_ isn't an empty string.
0 commit comments