Skip to content

Commit 2e2d8fb

Browse files
committed
update
1 parent fd855d1 commit 2e2d8fb

File tree

8 files changed

+55
-66
lines changed

8 files changed

+55
-66
lines changed

articles/azure-resource-manager/bicep/file.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,29 +106,29 @@ In a module, you can specify a scope that is different than the scope for the re
106106

107107
## Decorator
108108

109-
You can add one or more decorators for each of the following element:
109+
You can add one or more decorators for each of the following elements:
110110

111-
* Parameters
112-
* Variables
113-
* Resources
114-
* Modules
115-
* Ouputs
116-
* Types
111+
* [Parameter](#parameters)
112+
* [Variable](#variables)
113+
* [Resource](#resources)
114+
* [Module](#modules)
115+
* [Output](#outputs)
116+
* [Type](#types)
117117

118118
| Decorator | Apply to element | Apply to data type | Argument | Description |
119119
| --------- | ---- | ----------- | ------- |
120120
| allowed | [parameter](./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.|
121121
| batchSize |[resource](./resource-declaration.md#batchsize), [module](./modules.md#batchsize)| N/A | integer | Set up instances to deploy sequentially. |
122-
| description | [parameter](./parameters.md#description), [variable](./variables.md#description), [resource](./resource-declaration.md#description), [module](./modules.md#description), [output](./outputs.md#description), [user-defined data type](./user-defined-data-types.md#description) | all | string | Text that explains how to use the element. |
123-
| discriminator | parameter | 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).|
124-
| export | variable, type, function ||||
125-
| maxLength | parameter | array, string | int | The maximum length for string and array parameters. The value is inclusive. |
126-
| maxValue | parameter | int | int | The maximum value for the integer parameter. This value is inclusive. |
127-
| metadata | parameter | all | object | Custom properties to apply to the parameter. Can include a description property that is equivalent to the description decorator. |
128-
| minLength | parameter | array, string | int | The minimum length for string and array parameters. The value is inclusive. |
129-
| minValue | parameter | int | int | The minimum value for the integer parameter. This value is inclusive. |
130-
| 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). |
131-
| 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). |
122+
| description | [parameter](./parameters.md#description), [variable](./variables.md#description), [resource](./resource-declaration.md#description), [module](./modules.md#description), [output](./outputs.md#description), [type](./user-defined-data-types.md#description), [function](./user-defined-functions.md#description) | all | string | Text that explains how to use the element. |
123+
| discriminator | [parameter](./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).|
124+
| export | [variable](./variables.md#export), [type](./user-defined-data-types.md#export), [function](./user-defined-functions.md#export) | all | none| Indicates that the element can be imported by another Bicep file. |
125+
| maxLength | [parameter](./parameters.md#length-constraints), [output](./outputs.md#length-constraints) | array, string | int | The maximum length for string and array elemenets. The value is inclusive. |
126+
| maxValue | [parameter](./parameters.md#integer-constraints), [output](./outputs.md#integer-constraints) | int | int | The maximum value for the integer elements. This value is inclusive. |
127+
| metadata | [parameter](./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. |
128+
| minLength | [parameter](./parameters.md#length-constraints), [output](./outputs.md#length-constraints) | array, string | int | The minimum length for string and array elements. The value is inclusive. |
129+
| minValue | [parameter](./parameters.md#integer-constraints), [output](./outputs.md#integer-constraints) | int | int | The minimum value for the integer elements. This value is inclusive. |
130+
| sealed | [parameter](./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). |
131+
| secure | [parameter](./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). |
132132

133133
## Parameters
134134

articles/azure-resource-manager/bicep/modules.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ Bicep modules are converted into a single Azure Resource Manager template with [
2525

2626
If you would rather learn about modules through step-by-step guidance, see [Create composable Bicep files by using modules](/training/modules/create-composable-bicep-files-using-modules/).
2727

28-
## Definition syntax
28+
## Define modules
2929

3030
The basic syntax for defining a module is:
3131

3232
```bicep
33+
@<decorator>(<argument>)
3334
module <symbolic-name> '<path-to-file>' = {
3435
name: '<linked-deployment-name>'
3536
params: {
@@ -274,7 +275,7 @@ Decorators are written in the format `@expression` and are placed above module d
274275

275276
| Decorator | Argument | Description |
276277
| --------- | ----------- | ------- |
277-
| [description](#description) | string | Text that explains how to use the variable.|
278+
| [description](#description) | string |Provide descriptions for the module.|
278279
| [batchSize](./bicep-import.md#export-variables-types-and-functions) | none | Set up instances to deploy sequentially. |
279280

280281
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.

articles/azure-resource-manager/bicep/outputs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.date: 08/20/2024
1010

1111
This article describes how to define output values in a Bicep file. You use outputs when you need to return values from the deployed resources. You are limited to 64 outputs in a Bicep file. For more information, see [Template limits](../templates/best-practices.md#template-limits).
1212

13-
## Define output values
13+
## Define outputs
1414

1515
The syntax for defining an output value is:
1616

@@ -62,7 +62,7 @@ Decorators are written in the format `@expression` and are placed above ouput de
6262

6363
| Decorator | Apply to | Argument | Description |
6464
| --------- | ---- | ----------- | ------- |
65-
| [description](#description) | all | string | Text that explains how to use the output. |
65+
| [description](#description) | all | string | Provide descriptions for the output. |
6666
| [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).|
6767
| [maxLength](#length-constraints) | array, string | int | The maximum length for string and array outputs. The value is inclusive. |
6868
| [maxValue](#integer-constraints) | int | int | The maximum value for the integer output. This value is inclusive. |

articles/azure-resource-manager/bicep/parameters.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ For parameter best practices, see [Parameters](./best-practices.md#parameters).
2222

2323
If you would rather learn about parameters through step-by-step guidance, see [Build reusable Bicep templates by using parameters](/training/modules/build-reusable-bicep-templates-parameters).
2424

25-
## Declare parameters
25+
## Define parameters
2626

2727
Each parameter has a name and [data type](data-types.md). Optionally, you can provide a default value for the parameter.
2828

2929
```bicep
30+
@<decorator>(<argument>)
3031
param <parameter-name> <parameter-data-type> = <default-value>
3132
```
3233

articles/azure-resource-manager/bicep/resource-declaration.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.date: 08/20/2024
1010

1111
This article describes the syntax you use to add a resource to your Bicep file. You are limited to 800 resources in a Bicep file. For more information, see [Template limits](../templates/best-practices.md#template-limits).
1212

13-
## Declaration
13+
## Define resources
1414

1515
Add a resource declaration by using the `resource` keyword. You set a symbolic name for the resource. The symbolic name isn't the same as the resource name. You use the symbolic name to reference the resource in other parts of your Bicep file.
1616

@@ -66,7 +66,7 @@ Decorators are written in the format `@expression` and are placed above resource
6666

6767
| Decorator | Argument | Description |
6868
| --------- | ----------- | ------- |
69-
| [description](#description) | string | Text that explains how to use the variable.|
69+
| [description](#description) | string | Provide descriptions for the resource. |
7070
| [batchSize](./bicep-import.md#export-variables-types-and-functions) | none | Set up instances to deploy sequentially. |
7171

7272
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.
@@ -123,7 +123,7 @@ resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' = {
123123
}
124124
```
125125

126-
## Location
126+
## Resource location
127127

128128
Many resources require a location. You can determine if the resource needs a location either through intellisense or [template reference](/azure/templates/). The following example adds a location parameter that is used for the storage account.
129129

@@ -167,11 +167,11 @@ az provider show \
167167

168168
---
169169

170-
## Tags
170+
## Resource tags
171171

172172
You can apply tags to a resource during deployment. Tags help you logically organize your deployed resources. For examples of the different ways you can specify the tags, see [ARM template tags](../management/tag-resources-bicep.md).
173173

174-
## Managed identities for Azure resources
174+
## Managed identities for resources
175175

176176
Some resources support [managed identities for Azure resources](../../active-directory/managed-identities-azure-resources/overview.md). Those resources have an identity object at the root level of the resource declaration.
177177

articles/azure-resource-manager/bicep/user-defined-data-types.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ Learn how to create user-defined data types in Bicep. For system-defined data ty
1212

1313
[Bicep CLI version 0.12.X or higher](./install.md) is required to use this feature.
1414

15-
## Syntax
15+
## Define types
1616

1717
You can use the `type` statement to create user-defined data types. In addition, you can also use type expressions in some places to define custom types.
1818

1919
```bicep
20+
@<decorator>(<argument>)
2021
type <user-defined-data-type-name> = <type-expression>
2122
```
2223

@@ -233,8 +234,8 @@ Decorators are written in the format `@expression` and are placed above the decl
233234

234235
| Decorator | Argument | Description |
235236
| --------- | ----------- | ------- |
237+
| [description](#description) | string | Provide descriptions for the user-defined data type. |
236238
| [discriminator](#discriminator) | string | Use this decorator to ensure the correct subclass is identified and managed. |
237-
| [description](#description) | string | Text that explains how to use the user-defined data type. |
238239
| [export](#export) | none | Indicates that the user-defined data type can be imported by another file. |
239240
| [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).|
240241

@@ -352,22 +353,6 @@ output config object = serviceConfig
352353

353354
For more information, see [Custom tagged union data type](./data-types.md#custom-tagged-union-data-type).
354355

355-
## Import types between Bicep files
356-
357-
Only user-defined data types that bear the `@export()` decorator can be imported to other templates.
358-
359-
The following example enables you to import the two user-defined data types from other templates:
360-
361-
```bicep
362-
@export()
363-
type myStringType = string
364-
365-
@export()
366-
type myOtherStringType = myStringType
367-
```
368-
369-
For more information, see [Import user-defined data types](./bicep-import-providers.md#import-user-defined-data-types-preview).
370-
371356
## Next steps
372357

373358
- For a list of the Bicep data types, see [Data types](./data-types.md).

articles/azure-resource-manager/bicep/user-defined-functions.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ There are some restrictions when defining a user function:
2121
* The function can't use the [reference](bicep-functions-resource.md#reference) function or any of the [list](bicep-functions-resource.md#list) functions.
2222
* Parameters for the function can't have default values.
2323

24-
## Define the function
24+
## Define functions
2525

2626
Use the `func` statement to define user-defined functions.
2727

2828
```bicep
29+
@<decorator>(<argument>)
2930
func <user-defined-function-name> (<argument-name> <data-type>, <argument-name> <data-type>, ...) <function-data-type> => <expression>
3031
```
3132

@@ -101,18 +102,31 @@ The output from the preceding example is:
101102
| ---- | ---- | ----- |
102103
| elements | positiveInt | 3 |
103104

104-
## Import functions between Bicep files
105+
## Use decorators
105106

106-
Only functions that bear the `@export()` decorator can be imported to other templates.
107+
Decorators are written in the format `@expression` and are placed above function declarations. The following table shows the available decorators for functions.
107108

108-
The following example enables you to import the user-defined function from other templates:
109+
| Decorator | Argument | Description |
110+
| --------- | ----------- | ------- |
111+
| [description](#description) | string | Provide descriptions for the function. |
112+
| [export](#export) | none | Indicates that the function can be imported by another file. |
113+
114+
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.
115+
116+
### Description
117+
118+
To add explaination, add a description to function declaration. For example:
109119

110120
```bicep
111-
@export()
112-
func sayHello(name string) string => 'Hello ${name}!'
121+
@description('The say hello function.')
122+
func sayHelloString(name string) string => 'Hi ${name}!'
113123
```
114124

115-
For more information, see [Import variables, functions, and types](./bicep-import.md#import-types-variables-and-functions).
125+
Markdown-formatted text can be used for the description text.
126+
127+
### Export
128+
129+
Use `@export()` to share the function with other Bicep files. For more information, see [Export variables, types, and functions](./bicep-import.md#export-variables-types-and-functions).
116130

117131
## Next steps
118132

articles/azure-resource-manager/bicep/variables.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ You are limited to 256 variables in a Bicep file. For more information, see [Tem
1919
The syntax for defining a variable is:
2020

2121
```bicep
22+
@<decorator>(<argument>)
2223
var <variable-name> = <variable-value>
2324
```
2425

@@ -120,7 +121,7 @@ Decorators are written in the format `@expression` and are placed above variable
120121

121122
| Decorator | Argument | Description |
122123
| --------- | ----------- | ------- |
123-
| [description](#description) | string | Text that explains how to use the variable. |
124+
| [description](#description) | string | Provide descriptions for the variable. |
124125
| [export](#export) | none | Indicates that the variable can be imported by another file. |
125126

126127
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.
@@ -164,19 +165,6 @@ output stgOutput string = storageName
164165

165166
Because storage account names must use lowercase letters, the `storageName` variable uses the `toLower` function to make the `storageNamePrefix` value lowercase. The `uniqueString` function creates a unique value from the resource group ID. The values are concatenated to a string.
166167

167-
## Import variables between Bicep files
168-
169-
Only variables that bear the `@export()` decorator can be imported to other templates.
170-
171-
The following example enables you to import the variable from other templates:
172-
173-
```bicep
174-
@export()
175-
var myConstant = 'This is a constant value'
176-
```
177-
178-
For more information, see [Import variables, types, and functions](./bicep-import.md#import-variables-types-and-functions).
179-
180168
## Configuration variables
181169

182170
You can define variables that hold related values for configuring an environment. You define the variable as an object with the values. The following example shows an object that holds values for two environments - **test** and **prod**. Pass in one of these values during deployment.

0 commit comments

Comments
 (0)