Skip to content

Commit e9853a9

Browse files
committed
edits
1 parent 309195d commit e9853a9

File tree

7 files changed

+59
-59
lines changed

7 files changed

+59
-59
lines changed
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.azure.child-extension-bicep-templates.introduction
3-
title: Introduction
4-
metadata:
5-
unitType: introduction
6-
title: Introduction
7-
description: Learn how to deploy child and extension resources, and refer to existing resources, within your Bicep code.
8-
ms.date: 01/31/2025
9-
author: mumian
10-
ms.author: jgao
11-
ms.topic: unit
12-
ms.custom:
13-
- devx-track-bicep
14-
durationInMinutes: 2
15-
content: |
16-
[!include[](includes/1-introduction.md)]
17-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.child-extension-bicep-templates.introduction
3+
title: Introduction
4+
metadata:
5+
unitType: introduction
6+
title: Introduction
7+
description: Learn how to deploy child and extension resources, and refer to existing resources, in your Bicep code.
8+
ms.date: 05/27/2025
9+
author: mumian
10+
ms.author: jgao
11+
ms.topic: unit
12+
ms.custom:
13+
- devx-track-bicep
14+
durationInMinutes: 2
15+
content: |
16+
[!include[](includes/1-introduction.md)]
17+
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.azure.child-extension-bicep-templates.resource-types
3-
title: Understand Azure resources
4-
metadata:
5-
unitType: learning-content
6-
title: Understand Azure resources
7-
description: Learn about Azure resource types and resource IDs.
8-
ms.date: 01/31/2025
9-
author: mumian
10-
ms.author: jgao
11-
ms.topic: unit
12-
ms.custom:
13-
- devx-track-bicep
14-
durationInMinutes: 3
15-
content: |
16-
[!include[](includes/2-understand-azure-resources.md)]
17-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.child-extension-bicep-templates.resource-types
3+
title: Understand Azure resources
4+
metadata:
5+
unitType: learning-content
6+
title: Understand Azure resources
7+
description: Learn about Azure resource types and resource IDs.
8+
ms.date: 05/27/2025
9+
author: mumian
10+
ms.author: jgao
11+
ms.topic: unit
12+
ms.custom:
13+
- devx-track-bicep
14+
durationInMinutes: 3
15+
content: |
16+
[!include[](includes/2-understand-azure-resources.md)]
17+

learn-pr/azure/child-extension-bicep-templates/includes/2-understand-azure-resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Every Azure resource has a unique resource ID. This ID includes information that
4242

4343
Here's a visual representation of the same information:
4444

45-
:::image type="content" source="../media/2-resource-id.png" alt-text="Resource ID for a storage account, split with key/value pair on a separate line." border="false":::
45+
:::image type="content" source="../media/2-resource-id.png" alt-text="Diagram that shows a resource ID for a storage account. Each component of the ID is presented on a separate line." border="false":::
4646

4747
You can see that a resource ID contains information about the resource type and the specific resource you deployed. Here's a breakdown of this example resource ID into its components:
4848

learn-pr/azure/child-extension-bicep-templates/includes/3-define-child-resources.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,49 @@ It makes sense to deploy some resources only within the context of their parent.
1010
| Azure Cosmos DB containers | `Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers` |
1111
| | |
1212

13-
For example, let's consider a storage blob container. A blob container must be deployed into a storage account, and it doesn't make sense for a container to exist outside of a storage account.
13+
For example, consider a storage blob container. A blob container must be deployed into a storage account, and it doesn't make sense for a container to exist outside of a storage account.
1414

15-
Child resource types have longer names with multiple parts to them. A storage blob container has this fully qualified type name: `Microsoft.Storage/storageAccounts/blobServices/containers`. The resource ID for a blob container includes the name of the storage account that contains the container, and the container's name.
15+
Child resource types have longer names that are made up of multiple parts. A storage blob container has this fully qualified type name: `Microsoft.Storage/storageAccounts/blobServices/containers`. The resource ID for a blob container includes the name of the storage account that contains the container, and the container's name.
1616

1717
> [!NOTE]
1818
> Some child resources might have the same name as other child resource types from different parents. For example, `containers` is a child type of both storage accounts and Azure Cosmos DB databases. The names are the same, but they represent different resources, and their fully qualified type names are different.
1919
2020
## How are child resources defined?
2121

22-
With Bicep, you can declare child resources in several different ways. Each way has its own advantages, and each is suitable for some situations and not for others. Let's look at each approach.
22+
With Bicep, you can declare child resources in several ways. Each method has its own advantages, and each is suitable for some situations and not for others. The following sections describe each approach.
2323

2424
> [!TIP]
25-
> All of the following approaches result in the same deployment activities in Azure. You can choose the approach that best fits your needs without having to worry about breaking something. And you can update your template and change the approach you're using.
25+
> All the following approaches result in the same deployment activities in Azure. You can choose the approach that best fits your needs without having to worry about breaking anything. And you can update your template and change the approach you're using.
2626
2727
### Nested resources
2828

29-
One approach to defining a child resource is to *nest* the child resource inside the parent. Here's an example of a Bicep template that deploys a virtual machine and a virtual machine extension. A virtual machine extension is a child resource that provides extra behavior for a virtual machine. In this case, the extension runs a custom script on the virtual machine after deployment.
29+
One approach to defining a child resource is to *nest* the child resource inside the parent. Here's an example of a Bicep template that deploys a virtual machine and a virtual machine extension. A *virtual machine extension* is a child resource that provides extra behavior for a virtual machine. In this case, the extension runs a custom script on the virtual machine after deployment.
3030

3131
:::code language="bicep" source="code/3-nested.bicep" highlight="8-14":::
3232

3333
Notice that the nested resource has a simpler resource type than normal. Even though the fully qualified type name is `Microsoft.Compute/virtualMachines/extensions`, the nested resource automatically inherits the parent's resource type, so you need to specify only the child resource type, `extensions`.
3434

3535
Also notice that there's no API version specified for the nested resource. Bicep assumes that you want to use the same API version as the parent resource, although you can override the API version if you want to.
3636

37-
You can refer to a nested resource by using the `::` operator. For example, you could create an output that returns the full resource ID of the extension:
37+
You can refer to a nested resource by using the `::` operator. For example, you can create an output that returns the full resource ID of the extension:
3838

3939
```bicep
4040
output childResourceId string = vm::installCustomScriptExtension.id
4141
```
4242

43-
Nesting resources is a simple way to declare a child resource. Nesting resources also makes the parent-child relationship obvious to anyone reading the template. However, if you have lots of nested resources, or multiple layers of nesting, templates can become harder to read. You can also nest resources only up to five layers deep.
43+
Nesting resources is a simple way to declare a child resource. Nesting resources also makes the parent-child relationship obvious to anyone reading the template. However, if you have lots of nested resources, or multiple layers of nesting, templates can become harder to read. Also, you can only nest resources up to five layers deep.
4444

4545
### Parent property
4646

47-
A second approach is to declare the child resource without any nesting. Then, use the `parent` property to tell Bicep about the parent-child relationship:
47+
A second approach is to declare the child resource without any nesting. Then, use the `parent` property to inform Bicep about the parent-child relationship:
4848

4949
:::code language="bicep" source="code/3-parent-keyword.bicep" highlight="10":::
5050

5151
Notice that the child resource uses the `parent` property to refer to the symbolic name of its parent.
5252

53-
This approach to referencing the parent is another easy way to declare a child resource. Bicep understands the relationship between parent and child resources, so you don't need to specify the fully qualified resource name or set up a dependency between the resources. The approach also avoids having too much nesting, which can become difficult to read. However, you need to explicitly specify the full resource type and API version each time you define a child resource using the `parent` property.
53+
This approach to referencing the parent is another easy way to declare a child resource. Bicep understands the relationship between parent and child resources, so you don't need to specify the fully qualified resource name or set up a dependency between the resources. This approach also avoids having too much nesting, which can become difficult to read. However, you need to explicitly specify the full resource type and API version each time you define a child resource by using the `parent` property.
5454

55-
To refer to a child resource declared with the `parent` property, use its symbolic name as you would with a normal parent resource:
55+
To refer to a child resource that's declared with the `parent` property, use its symbolic name as you would with a normal parent resource:
5656

5757
```bicep
5858
output childResourceId string = installCustomScriptExtension.id
@@ -64,60 +64,60 @@ There are some circumstances where you can't use nested resources or the `parent
6464

6565
:::code language="bicep" source="code/3-manual-resource-type.bicep" highlight="10":::
6666

67-
Notice that this example uses string interpolation to append the virtual machine resource `name` property to the child resource name. Bicep understands that there's a dependency between your child and parent resources. You could declare the child resource name by using the `vmName` variable instead. If you do that, though, your deployment could possibly fail because Bicep wouldn't understand that the parent resource needs to be deployed before the child resource:
67+
Notice that this example uses string interpolation to append the virtual machine resource `name` property to the child resource name. Bicep understands that there's a dependency between your child and parent resources. You could declare the child resource name by using the `vmName` variable instead. If you do that, though, your deployment might fail because Bicep wouldn't understand that the parent resource needs to be deployed before the child resource.
6868

69-
To resolve this situation, you could manually tell Bicep about the dependency by using the `dependsOn` keyword, as shown here:
69+
To resolve this problem, you could manually inform Bicep about the dependency by using the `dependsOn` keyword, as shown here:
7070

7171
:::code language="bicep" source="code/3-manual-resource-type-dependson.bicep" highlight="11-13":::
7272

7373
> [!TIP]
74-
> It's generally best to avoid constructing resource names, because you lose a lot of the benefits that Bicep can provide when it understands the relationships between your resources. Use this option only when you can't use one of the other approaches for declaring child resources.
74+
> It's generally best to avoid constructing resource names because when you do you lose a lot of the benefits that Bicep provides when it understands the relationships between your resources. Use this option only when you can't use one of the other approaches for declaring child resources.
7575
7676
## Child resource IDs
7777

78-
You start creating a child resource ID by including its parent's resource ID and then appending the child resource type and name. For example, let's consider an Azure Cosmos DB account named `toyrnd`. The Azure Cosmos DB resource provider exposes a type called `databaseAccounts`, which is the parent resource you deploy:
78+
You start creating a child resource ID by including its parent's resource ID and then appending the child resource type and name. For example, consider an Azure Cosmos DB account named `toyrnd`. The Azure Cosmos DB resource provider exposes a type called `databaseAccounts`, which is the parent resource you deploy:
7979

8080
```
81-
/subscriptions/A123b4567c-1234-1a2b-2b1a-1234abc12345/resourceGroups/ToyDevelopment/providers/Microsoft.DocumentDB/databaseAccounts/toyrnd
81+
/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/ToyDevelopment/providers/Microsoft.DocumentDB/databaseAccounts/toyrnd
8282
```
8383

8484
Here's a visual depiction of the same resource ID:
8585

86-
:::image type="content" source="../media/3-parent-resource-id.png" alt-text="Resource ID for an Azure Cosmos DB account, split with the key-value pair on a separate line." border="false":::
86+
:::image type="content" source="../media/3-parent-resource-id.png" alt-text="Diagram that shows a resource ID for an Azure Cosmos DB account. Each of the four elements of the ID is presented on a separate line." border="false":::
8787

88-
If we add a database to this account, we can use the `sqlDatabases` child resource type. Let's add a database named `FlightTests` to our Azure Cosmos DB account and take a look at the child resource ID:
88+
If you add a database to this account, you can use the `sqlDatabases` child resource type. Say you add a database named `FlightTests` to the Azure Cosmos DB account. Here's the child resource ID:
8989

9090
```
91-
/subscriptions/A123b4567c-1234-1a2b-2b1a-1234abc12345/resourceGroups/ToyDevelopment/providers/Microsoft.DocumentDB/databaseAccounts/toyrnd/sqlDatabases/FlightTests
91+
/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/ToyDevelopment/providers/Microsoft.DocumentDB/databaseAccounts/toyrnd/sqlDatabases/FlightTests
9292
```
9393

9494
Here's a visual representation:
9595

96-
:::image type="content" source="../media/3-child-resource-id.png" alt-text="Child resource ID for an Azure Cosmos DB database, split with the key-value pair on a separate line." border="false":::
96+
:::image type="content" source="../media/3-child-resource-id.png" alt-text="Diagram that shows a child resource ID for an Azure Cosmos DB database. Each of the five elements of the ID is presented on a separate line." border="false":::
9797

9898
You can have multiple levels of child resources. Here's an example resource ID that shows a storage account with two levels of children:
9999

100100
```
101-
/subscriptions/A123b4567c-1234-1a2b-2b1a-1234abc12345/resourceGroups/ToyDevelopment/providers/Microsoft.Storage/storageAccounts/secrettoys/blobServices/default/containers/glitterspecs
101+
/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/ToyDevelopment/providers/Microsoft.Storage/storageAccounts/secrettoys/blobServices/default/containers/glitterspecs
102102
```
103103

104104
Here's a visual representation of the same resource ID:
105105

106-
:::image type="content" source="../media/3-storage-child-resource-id.png" alt-text="Child resource ID for a storage account with blob container, split with the key-value pair on a separate line." border="false":::
106+
:::image type="content" source="../media/3-storage-child-resource-id.png" alt-text="Diagram that shows a child resource ID for a storage account with blob container. The elements are presented on separate lines." border="false":::
107107

108-
This resource ID has several components to it:
108+
This resource ID has several components:
109109

110110
- Everything up to `secrettoys` is the parent resource ID.
111111

112112
- `blobServices` indicates that the resource is within a child resource type called `blobServices`.
113113

114114
> [!NOTE]
115-
> You don't have to create `blobServices` resources yourself. The `Microsoft.Storage` resource provider automatically creates this resource for you when you create a storage account. This type of resource is sometimes called an *implicit* resource. They're fairly uncommon, but you will find them throughout Azure.
115+
> You don't have to create `blobServices` resources yourself. The `Microsoft.Storage` resource provider automatically creates this resource when you create a storage account. This type of resource is sometimes called an *implicit* resource. They're fairly uncommon, but you can find them throughout Azure.
116116
117117
- `default` is the name of the `blobServices` child resource.
118118

119119
> [!NOTE]
120-
> Sometimes, only a single instance of a child resource is allowed. This type of instance is called a *singleton*, and it's often given the name `default`.
120+
> Sometimes only a single instance of a child resource is allowed. This type of instance is called a *singleton*, and it's often given the name `default`.
121121
122122
- `containers` indicates that the resource is within a child resource type called `containers`.
123123

-165 Bytes
Loading
-188 Bytes
Loading
-222 Bytes
Loading

0 commit comments

Comments
 (0)