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-import.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
@@ -43,7 +43,7 @@ import * as <alias_name> from '<bicep_file_name>'
43
43
44
44
You can mix and match the preceding syntaxes. To access imported symbols using the wildcard syntax, you must use the `.` operator: `<alias_name>.<exported_symbol>`.
45
45
46
-
Only statements that have been [exported](#exporting-types-variables-and-functions) in the file being referenced are available to be imported.
46
+
Only statements that have been [exported](#export-variables-types-and-functions) in the file being referenced are available to be imported.
47
47
48
48
Functionality that has been imported from another file can be used without restrictions. For example, imported variables can be used anywhere a variable declared in-file would normally be valid.
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/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
@@ -385,7 +385,7 @@ The union type syntax can be used in [user-defined data types](./user-defined-da
385
385
386
386
## Secure strings and objects
387
387
388
-
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.
388
+
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#use-decorators) to a string or object.
389
389
390
390
When you set a parameter to a secure string or secure object, the value of the parameter isn't saved to the deployment history and isn't logged. However, if you set that secure value to a property that isn't expecting a secure value, the value isn't protected. For example, if you set a secure string to a tag, that value is stored as plain text. Use secure strings for passwords and secrets.
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/file.md
+18-20Lines changed: 18 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,18 +118,18 @@ You can add one or more decorators for each of the following element.
118
118
119
119
| Decorator | Apply to element | Apply to data type | Argument | Description |
120
120
| --------- | ---- | ----------- | ------- |
121
-
|[allowed](#allowed-values)| parameter | 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.|
122
-
|[batch]()|resource, module||||
123
-
|[description](#description)| parameter, variable | all | string | Text that explains how to use the parameter. The description is displayed to users through the portal. |
124
-
|[discriminator](#property-name)| parameters | object | string | Use this decorator to ensure the correct subclass is identified and managed. For more information, see [Custom-tagged union data type](./data-types.md#custom-tagged-union-data-type).|
125
-
|[export]()| variable, type, function ||||
126
-
|[maxLength](#length-constraints)| parameter | array, string | int | The maximum length for string and array parameters. The value is inclusive. |
127
-
|[maxValue](#integer-constraints)| parameter | int | int | The maximum value for the integer parameter. This value is inclusive. |
128
-
|[metadata](#metadata)| parameter | all | object | Custom properties to apply to the parameter. Can include a description property that is equivalent to the description decorator. |
129
-
|[minLength](#length-constraints)| parameter | array, string | int | The minimum length for string and array parameters. The value is inclusive. |
130
-
|[minValue](#integer-constraints)| parameter | int | int | The minimum value for the integer parameter. This value is inclusive. |
131
-
|[sealed](#sealed)| parameter, type, output | object | none | Elevate [BCP089](./diagnostics/bcp089.md) from a warning to an error when a property name of a use-define data type is likely a typo. For more information, see [](./user-defined-data-types.md#elevate-error-level). |
132
-
|[secure](#secure-parameters)| parameter | string, object | none | Marks the parameter as secure. The value for a secure parameter isn't saved to the deployment history and isn't logged. For more information, see [Secure strings and objects](data-types.md#secure-strings-and-objects). |
121
+
| allowed | parameter | 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.|
122
+
| batch |resource, module||||
123
+
| description | parameter, variable | all | string | Text that explains how to use the parameter. The description is displayed to users through the portal. |
124
+
| discriminator | parameters | object | string | Use this decorator to ensure the correct subclass is identified and managed. For more information, see [Custom-tagged union data type](./data-types.md#custom-tagged-union-data-type).|
125
+
| export | variable, type, function ||||
126
+
| maxLength | parameter | array, string | int | The maximum length for string and array parameters. The value is inclusive. |
127
+
| maxValue | parameter | int | int | The maximum value for the integer parameter. This value is inclusive. |
128
+
| metadata | parameter | all | object | Custom properties to apply to the parameter. Can include a description property that is equivalent to the description decorator. |
129
+
| minLength | parameter | array, string | int | The minimum length for string and array parameters. The value is inclusive. |
130
+
| minValue | parameter | int | int | The minimum value for the integer parameter. This value is inclusive. |
131
+
| sealed | parameter, type, output | object | none | Elevate [BCP089](./diagnostics/bcp089.md) from a warning to an error when a property name of a use-define data type is likely a typo. For more information, see [Elevate error level](./user-defined-data-types.md#elevate-error-level). |
132
+
| secure | parameter | string, object | none | Marks the parameter as secure. The value for a secure parameter isn't saved to the deployment history and isn't logged. For more information, see [Secure strings and objects](data-types.md#secure-strings-and-objects). |
133
133
134
134
## Parameters
135
135
@@ -149,7 +149,7 @@ sku: {
149
149
}
150
150
```
151
151
152
-
You can add one or more decorators for each parameter. For more information, see [Decorators](./parameters.md#use-decorators).
152
+
You can add one or more decorators for each parameter. For more information, see [Use decorators](./parameters.md#use-decorators).
153
153
154
154
For more information, see [Parameters in Bicep](./parameters.md).
You can add one or more decorators for each user-defined data type. For more information, see [Decorators](./user-defined-data-types.md#use-decorators).
204
+
You can add one or more decorators for each user-defined data type. For more information, see [Use decorators](./user-defined-data-types.md#use-decorators).
205
205
206
206
For more information, see [User-defined data types](./user-defined-data-types.md).
The symbolic name enables you to reference the module from somewhere else in the file. For example, you can get an output value from a module by using the symbolic name and the name of the output value.
309
307
310
-
You can add one or more decorators for each module. For more information, see [Decorators](./modules.md#use-decorators).
308
+
You can add one or more decorators for each module. For more information, see [Use decorators](./modules.md#use-decorators).
311
309
312
310
For more information, see [Use Bicep modules](./modules.md).
313
311
@@ -319,7 +317,7 @@ Use outputs to return values from the deployment. Typically, you return a value
Decorators are written in the format `@expression` and are placed above module declarations. The following table shows the available decorators for modules.
274
+
275
+
| Decorator | Argument | Description |
276
+
| --------- | ----------- | ------- |
277
+
|[description](#description)| string | Text that explains how to use the variable.|
278
+
|[batchSize](./bicep-import.md#export-variables-types-and-functions)| none | Indicates that the variable can be imported by another file. |
279
+
280
+
Decorators are in the [sys namespace](bicep-functions.md#namespaces-for-functions). If you need to differentiate a decorator from another item with the same name, preface the decorator with `sys`. For example, if your Bicep file includes a parameter named `description`, you must add the sys namespace when using the **description** decorator.
281
+
282
+
### Description
283
+
284
+
To add explaination, add a description to module declarations. For example:
285
+
286
+
```bicep
287
+
@description('Create storage accounts referencing an AVM.')
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/parameters.md
+5-17Lines changed: 5 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,31 +89,19 @@ However, you can't reference a [variable](./variables.md) as the default value.
89
89
90
90
## Use decorators
91
91
92
-
Parameters use decorators for constraints or metadata. The decorators are in the format `@expression` and are placed above the parameter's declaration. You can mark a parameter as secure, specify allowed values, set the minimum and maximum length for a string, set the minimum and maximum value for an integer, and provide a description of the parameter.
93
-
94
-
The following example shows two common uses for decorators.
95
-
96
-
```bicep
97
-
@secure()
98
-
param demoPassword string
99
-
100
-
@description('Must be at least Standard_A3 to support 2 NICs.')
The following table describes the available decorators and how to use them.
92
+
Parameters use decorators for constraints or metadata. The decorators are in the format `@expression` and are placed above the parameter's declaration. The following table shows the available decorators for parameters.
105
93
106
94
| Decorator | Apply to | Argument | Description |
107
95
| --------- | ---- | ----------- | ------- |
108
96
|[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
97
|[description](#description)| all | string | Text that explains how to use the parameter. The description is displayed to users through the portal. |
110
-
|[discriminator](#property-name)| object | string | Use this decorator to ensure the correct subclass is identified and managed. For more information, see [Custom-tagged union data type](./data-types.md#custom-tagged-union-data-type).|
98
+
|[discriminator](#discriminator)| object | string | Use this decorator to ensure the correct subclass is identified and managed. For more information, see [Custom-tagged union data type](./data-types.md#custom-tagged-union-data-type).|
111
99
|[maxLength](#length-constraints)| array, string | int | The maximum length for string and array parameters. The value is inclusive. |
112
100
|[maxValue](#integer-constraints)| int | int | The maximum value for the integer parameter. This value is inclusive. |
113
101
|[metadata](#metadata)| all | object | Custom properties to apply to the parameter. Can include a description property that is equivalent to the description decorator. |
114
102
|[minLength](#length-constraints)| array, string | int | The minimum length for string and array parameters. The value is inclusive. |
115
103
|[minValue](#integer-constraints)| int | int | The minimum value for the integer parameter. This value is inclusive. |
116
-
|[sealed](#sealed)| object | none | Elevate [BCP089](./diagnostics/bcp089.md) from a warning to an error when a property name of a use-define data type is likely a typo. For more information, see [](./user-defined-data-types.md#elevate-error-level). |
104
+
|[sealed](#sealed)| object | none | Elevate [BCP089](./diagnostics/bcp089.md) from a warning to an error when a property name of a use-define data type is likely a typo. For more information, see [Elevate error level](./user-defined-data-types.md#elevate-error-level). |
117
105
|[secure](#secure-parameters)| string, object | none | Marks the parameter as secure. The value for a secure parameter isn't saved to the deployment history and isn't logged. For more information, see [Secure strings and objects](data-types.md#secure-strings-and-objects). |
118
106
119
107
Decorators are in the [sys namespace](bicep-functions.md#namespaces-for-functions). If you need to differentiate a decorator from another item with the same name, preface the decorator with `sys`. For example, if your Bicep file includes a parameter named `description`, you must add the sys namespace when using the **description** decorator.
@@ -125,8 +113,6 @@ param name string
125
113
param description string
126
114
```
127
115
128
-
The available decorators are described in the following sections.
129
-
130
116
### Allowed values
131
117
132
118
You can define allowed values for a parameter. You provide the allowed values in an array. The deployment fails during validation if a value is passed in for the parameter that isn't one of the allowed values.
@@ -232,6 +218,8 @@ param demoPassword string
232
218
param demoSecretObject object
233
219
```
234
220
221
+
There are several linter rules related to this decorator: [Secure parameter default](./linter-rule-secure-parameter-default.md), [Secure parameters in nested deployments](./linter-rule-secure-params-in-nested-deploy.md), [Secure secrets in parameters](./linter-rule-secure-secrets-in-parameters.md).
222
+
235
223
## Use parameters
236
224
237
225
To reference the value for a parameter, use the parameter name. The following example uses a parameter value for a key vault name.
Decorators are written in the format `@expression` and are placed above resource declarations. The following table shows the available decorators for resources.
65
66
67
+
| Decorator | Argument | Description |
68
+
| --------- | ----------- | ------- |
69
+
|[description](#description)| string | Text that explains how to use the variable.|
70
+
|[batchSize](./bicep-import.md#export-variables-types-and-functions)| none | Indicates that the variable can be imported by another file. |
66
71
67
-
## Resource and module decorators
72
+
Decorators are in the [sys namespace](bicep-functions.md#namespaces-for-functions). If you need to differentiate a decorator from another item with the same name, preface the decorator with `sys`. For example, if your Bicep file includes a parameter named `description`, you must add the sys namespace when using the **description** decorator.
68
73
69
-
You can add a decorator to a resource or module definition. The supported decorators are `batchSize(int)` and `description`. You can only apply it to a resource or module definition that uses a `for` expression.
74
+
### Description
70
75
71
-
By default, resources are deployed in parallel. When you add the `batchSize(int)` decorator, you deploy instances serially.
76
+
To add explaination, add a description to resource declarations. For example:
72
77
73
78
```bicep
74
-
@batchSize(3)
79
+
@description('Create a number of storage accounts')
75
80
resource storageAccountResources 'Microsoft.Storage/storageAccounts@2023-04-01' = [for storageName in storageAccounts: {
76
81
...
77
82
}]
78
83
```
79
84
80
-
For more information, see [Deploy in batches](loops.md#deploy-in-batches).
81
-
82
-
83
-
84
-
85
-
85
+
### BatchSize
86
86
87
+
You can only apply `@batchSize()` to a resource or module definition that uses a [`for` expression](./loops.md).
87
88
88
-
89
-
90
-
91
-
The following table describes the available decorators and how to use them.
92
-
93
-
| Decorator | Argument | Description |
94
-
| --------- | ----------- | ------- |
95
-
|[description](#description)| string | Text that explains how to use the variable.|
96
-
|[batchSize](./bicep-import.md#export-variables-types-and-functions)| none | Indicates that the variable can be imported by another file. |
97
-
98
-
Decorators are in the [sys namespace](bicep-functions.md#namespaces-for-functions). If you need to differentiate a decorator from another item with the same name, preface the decorator with `sys`. For example, if your Bicep file includes a parameter named `description`, you must add the sys namespace when using the **description** decorator.
99
-
100
-
You can add a decorator to a resource definition. The supported decorators are `@batchSize(int)` and `@description`.
89
+
By default, resources are deployed in parallel. When you add the `batchSize(int)` decorator, you deploy instances serially.
101
90
102
91
```bicep
103
-
@description('Create a number of storage accounts')
104
92
@batchSize(3)
105
93
resource storageAccountResources 'Microsoft.Storage/storageAccounts@2023-04-01' = [for storageName in storageAccounts: {
106
94
...
107
95
}]
108
96
```
109
97
110
-
You can only apply the `@batchSize()` decorator to a resource or module definition that uses a `for` expression. For more information, see [Deploy in batches](loops.md#deploy-in-batches).
98
+
For more information, see [Deploy in batches](loops.md#deploy-in-batches).
0 commit comments