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
@@ -119,17 +121,17 @@ You can add one or more decorators for each of the following elements:
119
121
| Decorator | Apply to element | Apply to data type | Argument | Description |
120
122
| --------- | ---- | ----------- | ------- |
121
123
| allowed |[param](./parameters.md#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.|
122
-
| batchSize |[resource](./resource-declaration.md#batchsize), [module](./modules.md#batchsize)| N/A | integer | Set up instances to deploy sequentially. |
123
-
| description |[param](./parameters.md#description), [var](./variables.md#description), [resource](./resource-declaration.md#description), [module](./modules.md#description), [output](./outputs.md#description), [type](./user-defined-data-types.md#description), [func](./user-defined-functions.md#description)| all | string | Provide descriptions for the elements. Markdown-formatted text can be used for the description text. |
124
+
| batchSize |[module](./modules.md#batchsize), [resource](./resource-declaration.md#batchsize)| N/A | integer | Set up instances to deploy sequentially. |
125
+
| description |[func](./user-defined-functions.md#description), [param](./parameters.md#description), [module](./modules.md#description), [output](./outputs.md#description), [resource](./resource-declaration.md#description), [type](./user-defined-data-types.md#description), [var](./variables.md#description)| all | string | Provide descriptions for the elements. Markdown-formatted text can be used for the description text. |
124
126
| discriminator |[param](./parameters.md#discriminator), [type](./user-defined-data-types.md#discriminator), [output](./outputs.md#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).|
125
-
| export |[var](./variables.md#export), [type](./user-defined-data-types.md#export), [func](./user-defined-functions.md#export)| all | none| Indicates that the element can be imported by another Bicep file. |
127
+
| export |[func](./user-defined-functions.md#export), [type](./user-defined-data-types.md#export), [var](./variables.md#export)| all | none| Indicates that the element can be imported by another Bicep file. |
126
128
| maxLength |[param](./parameters.md#length-constraints), [output](./outputs.md#length-constraints)| array, string | int | The maximum length for string and array elements. The value is inclusive. |
127
129
| maxValue |[param](./parameters.md#integer-constraints), [output](./outputs.md#integer-constraints)| int | int | The maximum value for the integer elements. This value is inclusive. |
128
130
| metadata |[param](./parameters.md#metadata), [output](./outputs.md#metadata)| all | object | Custom properties to apply to the elements. Can include a description property that is equivalent to the description decorator. |
129
131
| minLength |[param](./parameters.md#length-constraints), [output](./outputs.md#length-constraints)| array, string | int | The minimum length for string and array elements. The value is inclusive. |
130
132
| minValue |[param](./parameters.md#integer-constraints), [output](./outputs.md#integer-constraints)| int | int | The minimum value for the integer elements. This value is inclusive. |
131
133
| sealed |[param](./parameters.md#sealed), [type](./user-defined-data-types.md#sealed), [output](./outputs.md#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). |
132
-
| secure |[param](./parameters.md#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). |
134
+
| secure |[param](./parameters.md#secure-parameters), [type](./user-defined-data-types.md#sealed)| 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). |
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/user-defined-data-types.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -238,6 +238,7 @@ Decorators are written in the format `@expression` and are placed above the decl
238
238
|[discriminator](#discriminator)| string | Use this decorator to ensure the correct subclass is identified and managed. |
239
239
|[export](#export)| none | Indicates that the user-defined data type is available for import by another Bicep file. |
240
240
|[sealed](#sealed)| 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](#elevate-error-level).|
241
+
|[secure](#secure-parameters)| string, object | none | Marks the types as secure. The value for a secure type 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). |
241
242
242
243
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 variable named `description`, you must add the sys namespace when using the **description** decorator.
243
244
@@ -271,6 +272,18 @@ Use `@export()` to share the user-defined data type with other Bicep files. For
271
272
272
273
See [Elevate error level](#elevate-error-level).
273
274
275
+
### Secure types
276
+
277
+
You can mark string or object user-defined data type as secure. The value of a secure type isn't saved to the deployment history and isn't logged.
278
+
279
+
```bicep
280
+
@secure()
281
+
type demoPassword string
282
+
283
+
@secure()
284
+
type demoSecretObject object
285
+
```
286
+
274
287
## Elevate error level
275
288
276
289
By default, declaring an object type in Bicep allows it to accept additional properties of any type. For example, the following Bicep is valid but raises a warning of [BCP089] - `The property "otionalProperty" is not allowed on objects of type "{ property: string, optionalProperty: null | string }". Did you mean "optionalProperty"?`:
0 commit comments