Skip to content

Commit 5bcc384

Browse files
Merge pull request #239117 from mumian/0523-metadata-object
top-level metadata
2 parents e435a72 + d617cfa commit 5bcc384

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Bicep file structure and syntax
33
description: Describes the structure and properties of a Bicep file using declarative syntax.
44
ms.topic: conceptual
55
ms.custom: devx-track-bicep
6-
ms.date: 07/06/2022
6+
ms.date: 05/24/2023
77
---
88

99
# Understand the structure and syntax of Bicep files
@@ -19,6 +19,8 @@ Bicep is a declarative language, which means the elements can appear in any orde
1919
A Bicep file has the following elements.
2020

2121
```bicep
22+
metadata <metadata-name> = ANY
23+
2224
targetScope = '<scope>'
2325
2426
@<decorator>(<argument>)
@@ -43,6 +45,11 @@ output <output-name> <output-data-type> = <output-value>
4345
The following example shows an implementation of these elements.
4446

4547
```bicep
48+
metadata description = {
49+
description: 'Creates a storage account and a web app'
50+
}
51+
52+
@description('The prefix to use for the storage account name.')
4653
@minLength(3)
4754
@maxLength(11)
4855
param storagePrefix string
@@ -52,7 +59,7 @@ param location string = resourceGroup().location
5259
5360
var uniqueStorageName = '${storagePrefix}${uniqueString(resourceGroup().id)}'
5461
55-
resource stg 'Microsoft.Storage/storageAccounts@2019-04-01' = {
62+
resource stg 'Microsoft.Storage/storageAccounts@2022-09-01' = {
5663
name: uniqueStorageName
5764
location: location
5865
sku: {
@@ -71,10 +78,12 @@ module webModule './webApp.bicep' = {
7178
location: location
7279
}
7380
}
74-
75-
output storageEndpoint object = stg.properties.primaryEndpoints
7681
```
7782

83+
## Metadata
84+
85+
Metadata in Bicep is an untyped value that can be included in Bicep files. It allows you to provide supplementary information about your Bicep files, including details like its name, description, author, creation date, and more.
86+
7887
## Target scope
7988

8089
By default, the target scope is set to `resourceGroup`. If you're deploying at the resource group level, you don't need to set the target scope in your Bicep file.
@@ -110,7 +119,7 @@ For more information, see [Parameters in Bicep](./parameters.md).
110119

111120
## Parameter decorators
112121

113-
You can add one or more decorators for each parameter. These decorators describe the parameter and define constraints for the values that are passed in. The following example shows one decorator but many others are available.
122+
You can add one or more decorators for each parameter. These decorators describe the parameter and define constraints for the values that are passed in. The following example shows one decorator but many others are available.
114123

115124
```bicep
116125
@allowed([
@@ -143,7 +152,7 @@ For more information, see [Variables in Bicep](./variables.md).
143152

144153
## Resources
145154

146-
Use the `resource` keyword to define a resource to deploy. Your resource declaration includes a symbolic name for the resource. You'll use this symbolic name in other parts of the Bicep file to get a value from the resource.
155+
Use the `resource` keyword to define a resource to deploy. Your resource declaration includes a symbolic name for the resource. You use this symbolic name in other parts of the Bicep file to get a value from the resource.
147156

148157
The resource declaration includes the resource type and API version. Within the body of the resource declaration, include properties that are specific to the resource type.
149158

articles/azure-resource-manager/templates/syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Template structure and syntax
33
description: Describes the structure and properties of Azure Resource Manager templates (ARM templates) using declarative JSON syntax.
44
ms.topic: conceptual
55
ms.custom: ignite-2022, devx-track-arm-template
6-
ms.date: 09/28/2022
6+
ms.date: 05/01/2023
77
---
88

99
# Understand the structure and syntax of ARM templates

0 commit comments

Comments
 (0)