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/file.md
+3-1Lines changed: 3 additions & 1 deletion
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: Bicep file structure and syntax
3
3
description: Describes the structure and properties of a Bicep file using declarative syntax.
4
4
ms.topic: conceptual
5
-
ms.date: 09/30/2021
5
+
ms.date: 10/01/2021
6
6
---
7
7
8
8
# Understand the structure and syntax of Bicep files
@@ -179,6 +179,8 @@ param name string
179
179
param description string
180
180
```
181
181
182
+
For more information, see [Decorators](parameters.md#decorators).
183
+
182
184
## Variables
183
185
184
186
Use variables for complex expressions that are repeated in a Bicep file. For example, you might add a variable for a resource name that is constructed by concatenating several values together.
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/parameters.md
+19-7Lines changed: 19 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Describes how to define parameters in a Bicep file.
4
4
author: mumian
5
5
ms.author: jgao
6
6
ms.topic: conceptual
7
-
ms.date: 09/30/2021
7
+
ms.date: 10/01/2021
8
8
---
9
9
10
10
# Parameters in Bicep
@@ -51,7 +51,17 @@ You can use another parameter value to build a default value. The following temp
51
51
52
52
## Decorators
53
53
54
-
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. The following sections show how to use these decorators.
54
+
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.
55
+
56
+
The following example shows two common uses for decorators.
57
+
58
+
```bicep
59
+
@secure()
60
+
param demoPassword string
61
+
62
+
@description('Must be at least Standard_A3 to support 2 NICs.')
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.
57
67
@@ -62,7 +72,9 @@ param name string
62
72
param description string
63
73
```
64
74
65
-
## Secure parameters
75
+
The available decorators are described in the following sections.
76
+
77
+
### Secure parameters
66
78
67
79
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.
68
80
@@ -74,7 +86,7 @@ param demoPassword string
74
86
param demoSecretObject object
75
87
```
76
88
77
-
## Allowed values
89
+
###Allowed values
78
90
79
91
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.
80
92
@@ -86,7 +98,7 @@ You can define allowed values for a parameter. You provide the allowed values in
86
98
param demoEnum string
87
99
```
88
100
89
-
## Length constraints
101
+
###Length constraints
90
102
91
103
You can specify minimum and maximum lengths for string and array parameters. You can set one or both constraints. For strings, the length indicates the number of characters. For arrays, the length indicates the number of items in the array.
You can set minimum and maximum values for integer parameters. You can set one or both constraints.
108
120
@@ -112,7 +124,7 @@ You can set minimum and maximum values for integer parameters. You can set one o
112
124
param month int
113
125
```
114
126
115
-
## Description
127
+
###Description
116
128
117
129
To help users understand the value to provide, add a description to the parameter. When deploying the template through the portal, the description's text is automatically used as a tip for that parameter. Only add a description when the text provides more information than can be inferred from the parameter name.
0 commit comments