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
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ var mixedArray = ['abc', 'def'
39
39
'ghi']
40
40
```
41
41
42
-
In an array, each item is represented by the [any type](bicep-functions-any.md). You can have an array where each item is the same data type, or an array that holds different data types.
42
+
Each array element can be of any type. You can have an array where each item is the same data type, or an array that holds different data types.
43
43
44
44
The following example shows an array of integers and an array different types.
45
45
@@ -58,7 +58,7 @@ var mixedArray = [
58
58
]
59
59
```
60
60
61
-
Arrays in Bicep are zero-based. In the following example, the expression `exampleArray[0]` evaluates to 1 and `exampleArray[2]` evaluates to 3. The index of the indexer may itself be another expression. The expression `exampleArray[index]` evaluates to 2. Integer indexers are only allowed on expression of array types.
61
+
Arrays in Bicep are zero-based. In the following example, the expression `exampleArray[0]` evaluates to 1 and `exampleArray[2]` evaluates to 3. The index of the indexer can be another expression. The expression `exampleArray[index]` evaluates to 2. Integer indexers are only allowed on expression of array types.
62
62
63
63
```bicep
64
64
var index = 1
@@ -102,15 +102,15 @@ When specifying integer values, don't use quotation marks.
102
102
param exampleInt int = 1
103
103
```
104
104
105
-
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.
105
+
Bicep integers are 64-bit integers. When passed as inline parameters, the range of values can 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.
106
106
107
-
Bicep supports integer literal type which refers to a specific value that is an exact integer. In the following example, `1` is an integer literal type, `foo` can only be assigned the value `1` and no other value.
107
+
Bicep supports integer literal type that refers to a specific value that is an exact integer. In the following example, _1_ is an integer literal type, _foo_ can only be assigned the value _1_ and no other value.
108
108
109
109
```bicep
110
110
output foo 1 = 1
111
111
```
112
112
113
-
An integer literal type can either be declared inline, as shown in the preceeding example, or in a [`type` statement](./user-defined-data-types.md).
113
+
An integer literal type can either be declared inline, as shown in the preceding example, or in a [`type` statement](./user-defined-data-types.md).
114
114
115
115
```bicep
116
116
type oneType = 1
@@ -119,9 +119,9 @@ output foo oneType = 1
119
119
output bar oneType = 2
120
120
```
121
121
122
-
In the preceeding example, assigning `2` to `bar` will result in results in a [BCP033](./bicep-error-bcp033.md) error - _Expected a value of type "1" but the provided value is of type "2"_.
122
+
In the preceding example, assigning _2_ to _bar_ results in a [BCP033](./bicep-error-bcp033.md) error - _Expected a value of type "1" but the provided value is of type "2"_.
123
123
124
-
The following example, shows using integer literal type with [union type](#union-types):
124
+
The following example shows using integer literal type with [union type](#union-types):
125
125
126
126
```bicep
127
127
output bar 1 | 2 | 3 = 3
@@ -155,7 +155,7 @@ var test = {
155
155
}
156
156
```
157
157
158
-
In the preceding example, quotes are used when the object property keys contain special characters. For example space, '-', or '.'. The following example shows how to use interpolation in object property keys.
158
+
In the preceding example, quotes are used when the object property keys contain special characters. For example space, '-', or '.'. The following example shows how to use interpolation in object property keys.
In Bicep, strings are marked with singled quotes, and must be declared on a single line. All Unicode characters with code points between *0* and *10FFFF* are allowed.
222
+
In Bicep, strings are marked with singled quotes, and must be declared on a single line. All Unicode characters with code points between _0_ and _10FFFF_ are allowed.
223
223
224
224
```bicep
225
225
param exampleString string = 'test value'
@@ -234,21 +234,21 @@ The following table lists the set of reserved characters that must be escaped by
234
234
|`\n`| line feed (LF) ||
235
235
|`\r`| carriage return (CR) ||
236
236
|`\t`| tab character ||
237
-
| `\u{x}` | Unicode code point `x` | **x** represents a hexadecimal code point value between *0* and *10FFFF* (both inclusive). Leading zeros are allowed. Code points above *FFFF* are emitted as a surrogate pair.
237
+
|`\u{x}`| Unicode code point `x`|**x** represents a hexadecimal code point value between _0_ and _10FFFF_ (both inclusive). Leading zeros are allowed. Code points above _FFFF_ are emitted as a surrogate pair.|
238
238
|`\$`|`$`| Only escape when followed by `{`. |
239
239
240
240
```bicep
241
241
// evaluates to "what's up?"
242
242
var myVar = 'what\'s up?'
243
243
```
244
244
245
-
Bicep supports string literal type which refers to a specific string value. In the following example, `red` is a string literal type, `redColor` can only be assigned the value `red` and no other value.
245
+
Bicep supports string literal type that refers to a specific string value. In the following example, _red_ is a string literal type, _redColor_ can only be assigned the value _red_ and no other value.
246
246
247
247
```bicep
248
248
output redColor 'red' = 'red'
249
249
```
250
250
251
-
An string literal type can either be declared inline, as shown in the preceeding example, or in a [`type` statement](./user-defined-data-types.md).
251
+
A string literal type can either be declared inline, as shown in the preceding example, or in a [`type` statement](./user-defined-data-types.md).
In the preceeding example, assigning `blue` to `colorBlue` will result in results in a [BCP033](./bicep-error-bcp033.md) error - _Expected a value of type "'red'" but the provided value is of type "'blue'"_.
260
+
In the preceding example, assigning _blue_ to _colorBlue_ results in a [BCP033](./bicep-error-bcp033.md) error - _Expected a value of type "'red'" but the provided value is of type "'blue'"_.
261
261
262
-
The following example, shows using string literal type with [union type](#union-types):
262
+
The following example shows using string literal type with [union type](#union-types):
263
263
264
264
```bicep
265
265
type direction = 'north' | 'south' | 'east' | 'west'
@@ -319,7 +319,7 @@ is ${blocked}'''
319
319
320
320
## Union types
321
321
322
-
In Bicep, a union type allows the creation of a combined type consisting of a set of sub-types. An assignment is valid if any of the individual sub-type assignments are permitted. The `|` character separates individual sub-types using 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 constraint in Bicep, so only literals are permitted as members. Unions may include any number of literal-typed expressions.
322
+
In Bicep, a union type allows the creation of a combined type consisting of a set of sub-types. An assignment is valid if any of the individual sub-type assignments are permitted. The `|` character separates individual sub-types using 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 constraint in Bicep, so only literals are permitted as members. Unions can include any number of literal-typed expressions.
The parameter value is validated based on the discriminated property value. For instance, in the preceding example, if the _serviceConfig_ parameter is of type _foo_, it is validated using the _FooConfig_ type. Similarly, if the parameter is of type _bar_, it is validated using the _BarConfig_ type. This pattern applies to other types as well.
365
+
The parameter value is validated based on the discriminated property value. For instance, in the preceding example, if the _serviceConfig_ parameter is of type _foo_, it's validated using the _FooConfig_ type. Similarly, if the parameter is of type _bar_, it's validated using the _BarConfig_ type. This pattern applies to other types as well.
366
366
367
367
There are some limitations with union type.
368
368
369
-
* Union types must be reduceable to a single ARM type. The following definition is invalid:
369
+
* Union types must be reducible to a single Azure Resource Manager (ARM) type. The following definition is invalid:
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/parameters.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Resource Manager resolves parameter values before starting the deployment operat
14
14
15
15
Each parameter must be set to one of the [data types](data-types.md).
16
16
17
-
You're limited to 256 parameters in a Bicep file. For more information, see [Template limits](../templates/best-practices.md#template-limits).
17
+
Bicep allows a maximum of 256 parameters. For more information, see [Template limits](../templates/best-practices.md#template-limits).
18
18
19
19
For parameter best practices, see [Parameters](./best-practices.md#parameters).
20
20
@@ -59,7 +59,7 @@ param storageAccountConfig {
59
59
}
60
60
```
61
61
62
-
For more information, see [User-defined data types](./user-defined-data-types.md#user-defined-data-type-syntax).
62
+
For more information, see [User-defined data types](./user-defined-data-types.md#syntax).
63
63
64
64
## Default value
65
65
@@ -105,7 +105,7 @@ The following table describes the available decorators and how to use them.
105
105
106
106
| Decorator | Apply to | Argument | Description |
107
107
| --------- | ---- | ----------- | ------- |
108
-
|[allowed](#allowed-values)| all | array | Use this decorator to make sure the user provides correct values. This decorator is only permitted on `param` statements. To declare that a property must be one of a set of predefined values in a [`type`](./user-defined-data-types.md) or [`output`](./outputs.md) statement, use [union type syntax](./data-types.md#union-types). Union type syntax may also be used in `param` statements.|
108
+
|[allowed](#allowed-values)| all | array | Use this decorator to make sure the user provides correct values. This decorator is only permitted on `param` statements. To declare that a property must be one of a set of predefined values in a [`type`](./user-defined-data-types.md) or [`output`](./outputs.md) statement, use [union type syntax](./data-types.md#union-types). Union type syntax can also be used in `param` statements.|
109
109
|[description](#description)| all | string | Text that explains how to use the parameter. The description is displayed to users through the portal. |
110
110
|[maxLength](#length-constraints)| array, string | int | The maximum length for string and array parameters. The value is inclusive. |
111
111
|[maxValue](#integer-constraints)| int | int | The maximum value for the integer parameter. This value is inclusive. |
@@ -203,7 +203,7 @@ When you hover your cursor over **storageAccountName** in VS Code, you see the f
203
203
204
204
:::image type="content" source="./media/parameters/vscode-bicep-extension-description-decorator-markdown.png" alt-text="Use Markdown-formatted text in VSCode":::
205
205
206
-
Make sure the text follows proper Markdown formatting; otherwise, it may not display correctly when rendered
206
+
Make sure the text follows proper Markdown formatting; otherwise, it may not display correctly when rendered.
207
207
208
208
### Metadata
209
209
@@ -220,7 +220,7 @@ You might use this decorator to track information about the parameter that doesn
220
220
param settings object
221
221
```
222
222
223
-
When you provide a `@metadata()` decorator with a property that conflicts with another decorator, that decorator always takes precedence over anything in the `@metadata()` decorator. So, the conflicting property within the @metadata() value is redundant and will be replaced. For more information, see [No conflicting metadata](./linter-rule-no-conflicting-metadata.md).
223
+
When you provide a `@metadata()` decorator with a property that conflicts with another decorator, that decorator always takes precedence over anything in the `@metadata()` decorator. So, the conflicting property within the `@metadata()` value is redundant and will be replaced. For more information, see [No conflicting metadata](./linter-rule-no-conflicting-metadata.md).
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/user-defined-data-types.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Learn how to use user-defined data types in Bicep. For system-defined data types
12
12
13
13
[Bicep CLI version 0.12.X or higher](./install.md) is required to use this feature.
14
14
15
-
## The syntax
15
+
## Syntax
16
16
17
17
You can use the `type` statement to define user-defined data types. In addition, you can also use type expressions in some places to define custom types.
0 commit comments