Skip to content

Commit d8919ad

Browse files
committed
Merge branch '0501-metadata-object' of https://github.com/mumian/azure-docs-pr into 0523-metadata-object
2 parents ccc7f48 + 8fcf962 commit d8919ad

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

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

Lines changed: 16 additions & 5 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/01/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> = {}
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 bicepDescription = {
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,14 @@ 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 object 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+
87+
When assigning identifiers for metadata, [`param`](#parameters), [`var`](#variables), [`resource`](#resources), [`module`](#modules), and [`output`](#outputs), it's important to note that they share the same namespace as [decorators](./parameters.md#decorators) and [Bicep functions](./bicep-functions.md). Therefore, using the same identifier for metadata and a decorator (or a Bicep function) can cause confusion. It's advisable to choose a unique identifier that doesn't conflict with a decorator or a function. For instance, instead of using **description** as the metadata identifier, you could use **bicepDescription** to differentiate it from the **@description** decorator in the preceding example.
88+
7889
## Target scope
7990

8091
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.
@@ -143,7 +154,7 @@ For more information, see [Variables in Bicep](./variables.md).
143154

144155
## Resources
145156

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.
157+
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.
147158

148159
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.
149160

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)