Skip to content

Commit 3aaf4c6

Browse files
committed
edits
1 parent a13d86e commit 3aaf4c6

File tree

7 files changed

+55
-55
lines changed

7 files changed

+55
-55
lines changed
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.azure.child-extension-bicep-templates.exercise-define-child-resources
3-
title: Exercise - Define child resources
4-
sandbox: true
5-
metadata:
6-
unitType: exercise
7-
title: Exercise - Define child resources
8-
description: Learn how to create child resources in your Bicep template.
9-
ms.date: 01/31/2025
10-
author: mumian
11-
ms.author: jgao
12-
ms.topic: unit
13-
ms.custom: devx-track-bicep
14-
zone_pivot_groups: azure-shell-interface
15-
durationInMinutes: 10
16-
content: |
17-
[!include[](includes/4-exercise-define-child-resources.md)]
18-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.child-extension-bicep-templates.exercise-define-child-resources
3+
title: Exercise - Define child resources
4+
sandbox: true
5+
metadata:
6+
unitType: exercise
7+
title: Exercise - Define child resources
8+
description: Learn how to create child resources in your Bicep template.
9+
ms.date: 05/28/2025
10+
author: mumian
11+
ms.author: jgao
12+
ms.topic: unit
13+
ms.custom: devx-track-bicep
14+
zone_pivot_groups: azure-shell-interface
15+
durationInMinutes: 10
16+
content: |
17+
[!include[](includes/4-exercise-define-child-resources.md)]
18+
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.define-extension-resources
3-
title: Define extension resources
4-
metadata:
5-
unitType: learning-content
6-
title: Define extension resources
7-
description: Learn how to create extension resources in your Bicep template.
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/5-define-extension-resources.md)]
17-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.child-extension-bicep-templates.define-extension-resources
3+
title: Define extension resources
4+
metadata:
5+
unitType: learning-content
6+
title: Define extension resources
7+
description: Learn how to create extension resources in your Bicep template.
8+
ms.date: 05/28/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/5-define-extension-resources.md)]
17+

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ First, you create a new Bicep template that contains an Azure Cosmos DB account.
2121

2222
1. Save the empty file so that Visual Studio Code loads the Bicep tooling.
2323

24-
You can either select **File** > **Save As** or select <kbd>Ctrl+S</kbd> in Windows (<kbd>⌘+S</kbd> on macOS). Be sure to remember where you saved the file. For example, you might want to create a *scripts* folder to save it in.
24+
You can either select **File** > **Save As** or select <kbd>Ctrl+S</kbd> in Windows (<kbd>⌘+S</kbd> on macOS). Be sure to remember where you saved the file. For example, you might want to create a *templates* folder to save it in.
2525

2626
1. Add the following content to the file. It's a good idea to enter it manually rather than copy and paste it. That way, you can see how the tooling helps you write your Bicep files.
2727

@@ -79,7 +79,7 @@ Now you add another child resource. This time, you add it as a nested resource i
7979

8080
## Verify your Bicep file
8181

82-
After you've completed all of the preceding changes, your _main.bicep_ file should look like this example:
82+
After you complete the preceding steps, your _main.bicep_ file should look like this example:
8383

8484
:::code language="bicep" source="code/4-complete.bicep" :::
8585

@@ -127,7 +127,7 @@ New-AzResourceGroupDeployment -Name main -TemplateFile main.bicep
127127

128128
1. Select **<rgn>[sandbox resource group name]</rgn>**.
129129

130-
1. In **Overview**, you can see that one deployment succeeded.
130+
1. In the **Overview** pane, you can see that one deployment succeeded.
131131

132132
:::image type="content" source="../media/4-deployment-succeeded.png" alt-text="Screenshot of the Azure portal interface for the resource group overview, with the deployments section showing that one succeeded." border="true":::
133133

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For example, consider a lock, which can be used to prevent the deletion or modif
1616

1717
## How are extension resources defined?
1818

19-
In Bicep, you define an extension resource in mostly the same way as a normal resource. However, you add the `scope` property to tell Bicep that the resource should be attached to another resource defined elsewhere in the Bicep file. You use the resource's symbolic name to refer to it. For example, here's the definition of an Azure Cosmos DB account that we created previously:
19+
In Bicep, you mostly define an extension resource in the same way as you define a normal resource. However, you add the `scope` property to inform Bicep that the resource should be attached to another resource that's defined elsewhere in the Bicep file. You use the resource's symbolic name to refer to it. For example, here's the definition of an Azure Cosmos DB account that you created previously:
2020

2121
```bicep
2222
resource cosmosDBAccount 'Microsoft.DocumentDB/databaseAccounts@2024-05-15' = {
@@ -28,24 +28,24 @@ resource cosmosDBAccount 'Microsoft.DocumentDB/databaseAccounts@2024-05-15' = {
2828
}
2929
```
3030

31-
Let's add a resource lock, which prevents anybody from deleting the Azure Cosmos DB account:
31+
You can add a resource lock, which prevents anybody from deleting the Azure Cosmos DB account:
3232

3333
:::code language="bicep" source="code/5-scope.bicep" highlight="2":::
3434

35-
Notice that the example uses the `scope` property with the Azure Cosmos DB account's symbolic name. This property setting tells Bicep to deploy the resource lock onto the Azure Cosmos DB account, which means that it can no longer be deleted.
35+
Notice that the example uses the `scope` property with the Azure Cosmos DB account's symbolic name. This property setting informs Bicep to deploy the resource lock onto the Azure Cosmos DB account, so the account can no longer be deleted.
3636

3737
## Extension resource IDs
3838

39-
An extension resource has a slightly different ID than other resources. It consists of its parent resource ID, the separator `/providers/`, and the extension resource ID.
39+
An ID for an extension resource is slightly different than IDs for other resources. It consists of its parent resource ID, the separator `/providers/`, and the extension resource ID.
4040

41-
Let's say you deployed the previously mentioned Azure Cosmos DB account, and the account was named `toyrnd`. Here's what the lock's resource ID would look like:
41+
Say you deployed the previously mentioned Azure Cosmos DB account, and the account was named `toyrnd`. Here's what the lock's resource ID would look like:
4242

4343
```
44-
/subscriptions/A123b4567c-1234-1a2b-2b1a-1234abc12345/resourceGroups/ToyDevelopment/providers/Microsoft.DocumentDB/databaseAccounts/toyrnd/providers/Microsoft.Authorization/locks/DontDelete
44+
/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/ToyDevelopment/providers/Microsoft.DocumentDB/databaseAccounts/toyrnd/providers/Microsoft.Authorization/locks/DontDelete
4545
```
4646

4747
Here's a visual representation:
4848

49-
:::image type="content" source="../media/5-extension-resource-id.png" alt-text="Extension resource ID for a resource lock applied to an Azure Cosmos DB account, split with the key-value pair on a separate line." border="false":::
49+
:::image type="content" source="../media/5-extension-resource-id.png" alt-text="Diagram that shows an extension resource ID for a resource lock that's applied to an Azure Cosmos DB account. Each element of the ID appears on a separate line." border="false":::
5050

51-
If you see a resource ID that starts with a normal resource ID and then adds `/providers/` and another resource type and name, it means that you're looking at an extension resource ID.
51+
If you see a resource ID that starts with a normal resource ID and then includes `/providers/` and another resource type and name, you're looking at an extension resource ID.

learn-pr/azure/child-extension-bicep-templates/includes/6-work-with-existing-resources.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Bicep provides the `existing` keyword for you to use in these situations.
1010

1111
## Refer to existing resources
1212

13-
Within a Bicep file, you can define a resource that already exists. The declaration looks similar to a normal resource definition, but there are a few key differences. In the following example of an existing resource definition, the definition refers to a storage account named `toydesigndocs`. The storage account is in the same resource group that your Bicep template is deploying resources to.
13+
In a Bicep file, you can define a resource that already exists. The declaration looks similar to a normal resource definition, but there are a few key differences. In the following example of an existing resource definition, the definition refers to a storage account named `toydesigndocs`. The storage account is in the same resource group that your Bicep template is deploying resources to.
1414

1515
```bicep
1616
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' existing = {
@@ -23,15 +23,15 @@ Let's look closely at what makes up this definition:
2323
- As you would with a normal resource, you include the `resource` keyword, a symbolic name, and the resource type and API version.
2424

2525
> [!NOTE]
26-
> Remember, the symbolic name is used only within this Bicep file. If you create this resource by using one Bicep file and refer to it by using the `existing` resource in a different Bicep file, the symbolic names don't have to match.
26+
> Remember, the symbolic name is used only in the current Bicep file. If you create this resource by using one Bicep file and refer to it by using the `existing` resource in a different Bicep file, the symbolic names don't have to match.
2727
28-
- The `existing` keyword indicates to Bicep that this resource definition is a reference to an already-created resource, and that Bicep shouldn't try to deploy it.
28+
- The `existing` keyword indicates to Bicep that the resource definition is a reference to a resource that's arleady created, and that Bicep shouldn't try to deploy it.
2929
- The `name` property is the Azure resource name of the storage account that was previously deployed.
30-
- You don't need to specify the `location`, `sku`, or `properties`, because the template doesn't deploy the resource. It merely references an existing resource. Think of it as a placeholder resource.
30+
- You don't need to specify the `location`, `sku`, or `properties` because the template doesn't deploy the resource. It just references an existing resource. Think of it as a placeholder resource.
3131

3232
### Refer to child resources
3333

34-
You can refer to an existing child resource, too. Use the same kind of syntax that you used when you deployed a child resource. The following example shows how you can refer to an existing subnet, which is a child resource of a virtual network. The example uses a nested child resource, as shown here:
34+
You can also refer to an existing child resource. Use the same kind of syntax that you used when you deployed a child resource. The following example shows how you can refer to an existing subnet, which is a child resource of a virtual network. The example uses a nested child resource:
3535

3636
:::code language="bicep" source="code/6-child-existing.bicep" highlight="4-6":::
3737

@@ -45,17 +45,17 @@ output managementSubnetResourceId string = vnet::managementSubnet.id
4545

4646
### Refer to resources outside the resource group
4747

48-
Often, you need to refer to resources in a different resource group. For example, if you have a virtual network in a centralized resource group, you might want to deploy a virtual machine into that virtual network in its own resource group. You can use the `scope` keyword to refer to existing resources in a different resource group. The following example shows how you could refer to a virtual network named `toy-design-vnet` within the `networking-rg` resource group:
48+
You often need to refer to resources in a different resource group. For example, if you have a virtual network in a centralized resource group, you might want to deploy a virtual machine into that virtual network in its own resource group. You can use the `scope` keyword to refer to existing resources in a different resource group. The following example shows how you can refer to a virtual network named `toy-design-vnet` in the `networking-rg` resource group:
4949

5050
:::code language="bicep" source="code/6-resource-group-scope.bicep" highlight="2":::
5151

5252
Notice that the `scope` uses the `resourceGroup()` keyword to refer to the resource group that contains the virtual network.
5353

54-
You can even refer to resources within a different Azure subscription, as long as the subscription is within your Microsoft Entra tenant. If your networking team provisions the virtual network in a different subscription, the template could refer to it, as in this example:
54+
You can even refer to resources within a different Azure subscription, as long as the subscription is within your Microsoft Entra tenant. If your networking team provisions the virtual network in a different subscription, the template can refer to it as shown in this example:
5555

5656
:::code language="bicep" source="code/6-subscription-scope.bicep" highlight="2":::
5757

58-
Notice that the `scope` uses the `resourceGroup()` keyword to refer to the Azure subscription ID (`A123b4567c-1234-1a2b-2b1a-1234abc12345`) and resource group name that contains the virtual network.
58+
Notice that the `scope` uses the `resourceGroup()` keyword to refer to the Azure subscription ID (`aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e`) and resource group name that contains the virtual network.
5959

6060
Now that you understand how to refer to existing resources, let's look at how you can use this capability in your templates.
6161

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
resource vnet 'Microsoft.Network/virtualNetworks@2024-05-01' existing = {
2-
scope: resourceGroup('A123b4567c-1234-1a2b-2b1a-1234abc12345', 'networking-rg')
2+
scope: resourceGroup('aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e', 'networking-rg')
33
name: 'toy-design-vnet'
44
}
-194 Bytes
Loading

0 commit comments

Comments
 (0)