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
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
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
-
ms.date: 01/10/2025
5
+
ms.date: 05/09/2025
6
6
ms.custom: devx-track-bicep
7
7
---
8
8
@@ -423,7 +423,7 @@ You can use the union type syntax in [user-defined data types](./user-defined-da
423
423
424
424
Secure strings use the same format as string, and secure objects use the same format as object. With Bicep, you add the `@secure()` [decorator](./parameters.md#use-decorators) to a string or object.
425
425
426
-
When you set a parameter to a secure string or secure object, the value of the parameter isn't saved to the deployment history or logged. 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.
426
+
When you set a parameter (or an output) to a secure string or secure object, the value of the parameter (or the output) isn't saved to the deployment history or logged. 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.
427
427
428
428
The following example shows two secure parameters:
429
429
@@ -435,6 +435,8 @@ param password string
435
435
param configValues object
436
436
```
437
437
438
+
For more information, see [Secure parameters](./parameters.md#secure-parameters) and [Secure outputs](./outputs.md#secure-outputs).
439
+
438
440
## Data type assignability
439
441
440
442
In Bicep, you can assign a value of one type (source type) to another type (target type). The following table shows which source type (listed horizontally) you can or can't assign to which target type (listed vertically). In the table, _X_ means assignable, an empty space means not assignable, and _?_ means only if the types are compatible.
With Bicep version 0.35.1 and later, the `@secure()` decorator can be applied to module outputs to mark them as sensitive, ensuring that their values are not exposed in logs or deployment history. This is useful when a module needs to return sensitive data, such as a generated key or connection string, to the parent Bicep file without risking exposure. For more information, see [Secure outputs](./outputs.md#secure-outputs).
549
+
548
550
## Related content
549
551
550
552
- For a tutorial, see [Build your first Bicep template](/training/modules/deploy-azure-resources-by-using-bicep-templates/).
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/outputs.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Outputs in Bicep
3
3
description: Learn how to define output values in Bicep.
4
4
ms.topic: conceptual
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 03/25/2025
6
+
ms.date: 05/09/2025
7
7
---
8
8
9
9
# Outputs in Bicep
@@ -68,6 +68,7 @@ Decorators are written in the format `@expression` and are placed above output d
68
68
|[minLength](#length-constraints)| array, string | int | This provides the minimum length for string and array outputs, and the value is inclusive. |
69
69
|[minValue](#integer-constraints)| int | int | This provides the minimum value for the integer output, and the value is inclusive. |
70
70
|[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). |
71
+
|[secure](#secure-outputs)| string, object | none | Marks the output as secure. The value for a secure output 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). |
71
72
72
73
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.
73
74
@@ -150,6 +151,20 @@ When you provide a `@metadata()` decorator with a property that conflicts with a
150
151
151
152
See [Elevate error level](./user-defined-data-types.md#elevate-error-level).
152
153
154
+
### Secure outputs
155
+
156
+
With Bicep version 0.35.1 and later, you can mark string or object outputs as secure. When an output is decorated with `@secure()`, Azure Resource Manager treats the output value as sensitive, preventing it from being logged or displayed in deployment history, Azure portal, or command-line outputs.
157
+
158
+
```bicep
159
+
@secure()
160
+
output demoPassword string
161
+
162
+
@secure()
163
+
output demoSecretObject object
164
+
```
165
+
166
+
The `@secure()` decorator is valid only for outputs of type string or object, as these align with the [secureString](../templates/syntax.md#outputs) and [secureObject](../templates/syntax.md#outputs) types in ARM templates. To pass arrays or numbers securely, wrap them in a secureObject or serialize them as a secureString.
167
+
153
168
## Conditional output
154
169
155
170
When the value to return depends on a condition in the deployment, use the `?` operator.
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/parameters.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Parameters in Bicep files
3
3
description: Learn how to define and use parameters in a Bicep file.
4
4
ms.topic: conceptual
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 03/25/2025
6
+
ms.date: 05/09/2025
7
7
---
8
8
9
9
# Parameters in Bicep
@@ -207,7 +207,7 @@ See [Elevate error level](./user-defined-data-types.md#elevate-error-level).
207
207
208
208
### Secure parameters
209
209
210
-
You can mark string or object parameters as secure. The value of a secure parameter isn't saved to the deployment history and isn't logged.
210
+
You can mark string or object parameters as secure. When a parameter is decorated with `@secure()`, Azure Resource Manager treats the parameter value as sensitive, preventing it from being logged or displayed in deployment history, Azure Portal, or command-line outputs.
The `@secure()` decorator is valid only for parameters of type string or object, as these align with the [secureString](../templates/syntax.md#parameters) and [secureObject](../templates/syntax.md#parameters) types in ARM templates. To pass arrays or numbers securely, wrap them in a secureObject or serialize them as a secureString.
236
+
235
237
## Use objects as parameters
236
238
237
239
It can be easier to organize related values by passing them in as an object. This approach also reduces the number of parameters in the template.
0 commit comments