Skip to content

Commit f5e5024

Browse files
committed
0716-specific-integer-type
1 parent 573aa3e commit f5e5024

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

articles/azure-resource-manager/bicep/data-types.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Data types in Bicep
33
description: Describes the data types that are available in Bicep
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 11/03/2023
6+
ms.date: 07/16/2024
77
---
88

99
# Data types in Bicep
@@ -104,6 +104,19 @@ param exampleInt int = 1
104104

105105
In Bicep, integers are 64-bit integers. When passed as inline parameters, the range of values may be limited by the SDK or command-line tool you use for deployment. For example, when using PowerShell to deploy a Bicep, integer types can range from -2147483648 to 2147483647. To avoid this limitation, specify large integer values in a [parameter file](parameter-files.md). Resource types apply their own limits for integer properties.
106106

107+
You can use an integer as a specific integer type. In the following example, the first line is valid and defines an integer type with the value 1. The second line, however, results in a BCP033 error - Expected a value of type "2" but the provided value is of type "1".
108+
109+
```bicep
110+
output foo 1 = 1
111+
output bar 2 = 1
112+
```
113+
114+
The following example, shows using specific integer types with a [union type](#union-types):
115+
116+
```bicep
117+
output bar 1 | 2 | 3 = 3
118+
```
119+
107120
Floating point, decimal or binary formats aren't currently supported.
108121

109122
## Objects
@@ -268,6 +281,18 @@ var myVar6 = '''interpolation
268281
is ${blocked}'''
269282
```
270283

284+
## Union types
285+
286+
In Bicep, a union type represents one of several specified values within the same data type.
287+
288+
```bicep
289+
output color 'Red' | 'Blue' | 'White' = 'White'
290+
output foo 'true' | 'false' = 'false'
291+
output bar 1 | 2 | 3 = 3
292+
```
293+
294+
The union type syntax can also be used in [user-defined data types](./user-defined-data-types.md).
295+
271296
## Secure strings and objects
272297

273298
Secure string uses the same format as string, and secure object uses the same format as object. With Bicep, you add the `@secure()` [decorator](./parameters.md#decorators) to a string or object.

0 commit comments

Comments
 (0)