You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/azure/child-extension-bicep-templates/includes/4-exercise-define-child-resources.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ First, you create a new Bicep template that contains an Azure Cosmos DB account.
21
21
22
22
1. Save the empty file so that Visual Studio Code loads the Bicep tooling.
23
23
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.
25
25
26
26
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.
27
27
@@ -79,7 +79,7 @@ Now you add another child resource. This time, you add it as a nested resource i
79
79
80
80
## Verify your Bicep file
81
81
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:
@@ -127,7 +127,7 @@ New-AzResourceGroupDeployment -Name main -TemplateFile main.bicep
127
127
128
128
1. Select **<rgn>[sandbox resource group name]</rgn>**.
129
129
130
-
1. In **Overview**, you can see that one deployment succeeded.
130
+
1. In the **Overview** pane, you can see that one deployment succeeded.
131
131
132
132
:::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":::
Copy file name to clipboardExpand all lines: learn-pr/azure/child-extension-bicep-templates/includes/5-define-extension-resources.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ For example, consider a lock, which can be used to prevent the deletion or modif
16
16
17
17
## How are extension resources defined?
18
18
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:
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.
36
36
37
37
## Extension resource IDs
38
38
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.
40
40
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:
:::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":::
50
50
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.
Copy file name to clipboardExpand all lines: learn-pr/azure/child-extension-bicep-templates/includes/6-work-with-existing-resources.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Bicep provides the `existing` keyword for you to use in these situations.
10
10
11
11
## Refer to existing resources
12
12
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.
@@ -23,15 +23,15 @@ Let's look closely at what makes up this definition:
23
23
- As you would with a normal resource, you include the `resource` keyword, a symbolic name, and the resource type and API version.
24
24
25
25
> [!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.
27
27
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.
29
29
- 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.
31
31
32
32
### Refer to child resources
33
33
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:
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:
Notice that the `scope` uses the `resourceGroup()` keyword to refer to the resource group that contains the virtual network.
53
53
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:
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.
59
59
60
60
Now that you understand how to refer to existing resources, let's look at how you can use this capability in your templates.
0 commit comments