Skip to content

Commit 601359e

Browse files
committed
edits
1 parent 3aaf4c6 commit 601359e

File tree

7 files changed

+146
-146
lines changed

7 files changed

+146
-146
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.work-with-existing-resources
3-
title: Work with existing resources
4-
metadata:
5-
unitType: learning-content
6-
title: Work with existing resources
7-
description: Learn how to refer to existing resources within 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: 4
15-
content: |
16-
[!include[](includes/6-work-with-existing-resources.md)]
17-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.child-extension-bicep-templates.work-with-existing-resources
3+
title: Work with existing resources
4+
metadata:
5+
unitType: learning-content
6+
title: Work with existing resources
7+
description: Learn how to refer to existing 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: 4
15+
content: |
16+
[!include[](includes/6-work-with-existing-resources.md)]
17+
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.azure.child-extension-bicep-templates.exercise-deploy-extension-existing-resources
3-
title: Exercise - Deploy extension resources and use existing resources
4-
sandbox: true
5-
metadata:
6-
unitType: exercise
7-
title: Exercise - Refer to existing resources
8-
description: Learn how to deploy extension resources and refer to existing resources within your Bicep template.
9-
ms.date: 01/31/2025
10-
author: mumian
11-
ms.author: jgao
12-
ms.topic: unit
13-
ms.custom:
14-
- devx-track-bicep
15-
zone_pivot_groups: azure-shell-interface
16-
durationInMinutes: 5
17-
content: |
18-
[!include[](includes/7-exercise-deploy-extension-existing-resources.md)]
19-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.child-extension-bicep-templates.exercise-deploy-extension-existing-resources
3+
title: Exercise - Deploy extension resources and use existing resources
4+
sandbox: true
5+
metadata:
6+
unitType: exercise
7+
title: Exercise - Refer to existing resources
8+
description: Learn how to deploy extension resources and refer to existing 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:
14+
- devx-track-bicep
15+
zone_pivot_groups: azure-shell-interface
16+
durationInMinutes: 5
17+
content: |
18+
[!include[](includes/7-exercise-deploy-extension-existing-resources.md)]
19+
Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
1-
### YamlMime:ModuleUnit
2-
uid: learn.azure.child-extension-bicep-templates.knowledge-check
3-
title: Module assessment
4-
metadata:
5-
unitType: knowledge_check
6-
title: Module assessment
7-
description: "Knowledge check"
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: 4
15-
content: |
16-
quiz:
17-
questions:
18-
- content: |
19-
Your R&D team asked you to deploy an Azure SQL database so they can compare it to Azure Cosmos DB.
20-
An SQL database is a child resource of the Azure SQL logical server resource.
21-
Which of these statements is true?
22-
choices:
23-
- content: The SQL database resource might be in a different resource provider than its parent.
24-
isCorrect: false
25-
explanation: Incorrect. Child resources always exist within the same resource provider as their parent. Extension resources might exist in different resource providers.
26-
- content: You can use the `parent` property to tell Bicep about the relationship between the parent and child resources.
27-
isCorrect: true
28-
explanation: Correct. In Bicep, you define child resources by using the `parent` property, by using nested resources, or by constructing a child resource name directly.
29-
- content: An Azure SQL logical server instance is an implicit resource.
30-
isCorrect: false
31-
explanation: Incorrect. You need to explicitly deploy a logical server instance. It's not an implicit resource.
32-
- content: |
33-
You're asked to deploy an extension resource with the type: `Microsoft.Authorization/roleAssignments`.
34-
Which of these approaches should you consider?
35-
choices:
36-
- content: Use the `scope` property on a resource definition.
37-
isCorrect: true
38-
explanation: Correct. In Bicep, you define an extension resource by using the `scope` keyword.
39-
- content: Use the `parent` property on a resource definition.
40-
isCorrect: false
41-
explanation: Incorrect. You can define child resources by using the `parent` keyword, but this keyword isn't applicable to extension resources.
42-
- content: Use a nested resource declaration.
43-
isCorrect: false
44-
explanation: Incorrect. You can define child resources by using a nested resource definition, but you can't define extension resources in this way.
45-
- content: Which of these statements is true?
46-
choices:
47-
- content: Using the `existing` keyword on a resource declaration means that Bicep redeploys the resource.
48-
isCorrect: false
49-
explanation: Incorrect. The `existing` keyword means that Bicep doesn't attempt to deploy the resource. Use the keyword to refer to the resource within your Bicep template.
50-
- content: All resource definitions in a Bicep file need to have a SKU property set, even existing resources.
51-
isCorrect: false
52-
explanation: Incorrect. When you define a resource by using the `existing` keyword, you don't specify the SKU property or most other properties.
53-
- content: You can access the properties of existing resources by using the resource's symbolic name.
54-
isCorrect: true
55-
explanation: Correct. You can use an existing resource to access its properties, including secrets that the resource exposes.
56-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.child-extension-bicep-templates.knowledge-check
3+
title: Module assessment
4+
metadata:
5+
unitType: knowledge_check
6+
title: Module assessment
7+
description: "Knowledge check"
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: 4
15+
content: |
16+
quiz:
17+
questions:
18+
- content: |
19+
Your R&D team asked you to deploy an Azure SQL database so they can compare it to Azure Cosmos DB.
20+
An SQL database is a child resource of the Azure SQL logical server resource.
21+
Which of these statements is true?
22+
choices:
23+
- content: The SQL database resource might be in a different resource provider than its parent.
24+
isCorrect: false
25+
explanation: Incorrect. Child resources always exist in the same resource provider as their parent. Extension resources might exist in different resource providers.
26+
- content: You can use the `parent` property to inform Bicep about the relationship between the parent and child resources.
27+
isCorrect: true
28+
explanation: Correct. In Bicep, you define child resources by using the `parent` property, by using nested resources, or by constructing a child resource name directly.
29+
- content: An Azure SQL logical server instance is an implicit resource.
30+
isCorrect: false
31+
explanation: Incorrect. You need to explicitly deploy a logical server instance. It's not an implicit resource.
32+
- content: |
33+
You're asked to deploy an extension resource with the type `Microsoft.Authorization/roleAssignments`.
34+
Which of these approaches should you consider?
35+
choices:
36+
- content: Use the `scope` property on a resource definition.
37+
isCorrect: true
38+
explanation: Correct. In Bicep, you define an extension resource by using the `scope` keyword.
39+
- content: Use the `parent` property on a resource definition.
40+
isCorrect: false
41+
explanation: Incorrect. You can define child resources by using the `parent` keyword, but this keyword isn't applicable to extension resources.
42+
- content: Use a nested resource declaration.
43+
isCorrect: false
44+
explanation: Incorrect. You can define child resources by using a nested resource definition, but you can't define extension resources in this way.
45+
- content: Which of these statements is true?
46+
choices:
47+
- content: Using the `existing` keyword on a resource declaration means that Bicep redeploys the resource.
48+
isCorrect: false
49+
explanation: Incorrect. The `existing` keyword means that Bicep doesn't attempt to deploy the resource. Use the keyword to refer to the resource within your Bicep template.
50+
- content: All resource definitions in a Bicep file need to have an SKU property set, even existing resources.
51+
isCorrect: false
52+
explanation: Incorrect. When you define a resource by using the `existing` keyword, you don't need to specify the SKU property or most other properties.
53+
- content: You can access the properties of existing resources by using the resource's symbolic name.
54+
isCorrect: true
55+
explanation: Correct. You can use an existing resource to access its properties, including secrets that the resource exposes.
56+
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.summary
3-
title: Summary
4-
metadata:
5-
unitType: summary
6-
title: Summary
7-
description: This unit summarizes what you learned about using Bicep.
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: 1
15-
content: |
16-
[!include[](includes/9-summary.md)]
17-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.child-extension-bicep-templates.summary
3+
title: Summary
4+
metadata:
5+
unitType: summary
6+
title: Summary
7+
description: This unit summarizes what you learned about using Bicep.
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: 1
15+
content: |
16+
[!include[](includes/9-summary.md)]
17+

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Let's look closely at what makes up this definition:
2525
> [!NOTE]
2626
> 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 the resource definition is a reference to a resource that's arleady created, 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 already 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.
3030
- 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

@@ -61,7 +61,7 @@ Now that you understand how to refer to existing resources, let's look at how yo
6161

6262
## Add child and extension resources to an existing resource
6363

64-
You can add a child resource to an already-created parent resource by using a combination of the `existing` keyword and the `parent` keyword. The following example template creates an Azure SQL database within a server that already exists:
64+
You can add a child resource to an existing parent resource by using a combination of the `existing` keyword and the `parent` keyword. The following example template creates an Azure SQL database in a server that already exists:
6565

6666
:::code language="bicep" source="code/6-child-existing-deploy.bicep" highlight="1-3,6":::
6767

@@ -71,26 +71,26 @@ If you need to deploy an extension resource to an existing resource, you can use
7171

7272
## Refer to an existing resource's properties
7373

74-
Resources often need to refer to the properties of other resources. For example, if you deploy an application, it might need to know the keys or connection information for another resource. By using the `existing` keyword, you get access to the properties of the resource that you're referring to.
74+
Resources often need to refer to the properties of other resources. For example, if you deploy an application, it might need to know the keys or connection information for another resource. You can use the `existing` keyword to get access to the properties of the resource that you're referring to.
7575

7676
> [!TIP]
77-
> It's a best practice to look up keys from other resources in this way instead of passing them around through outputs. You'll always get the most up-to-date data. Also, importantly, outputs are not designed to handle secure data such as keys.
77+
> It's a best practice to look up keys from other resources in this way instead of passing them around through outputs. You'll always get the most up-to-date data. Also, it's important to note that outputs aren't designed to handle secure data like keys.
7878
79-
The way that you access the information about a resource depends on the type of information you're getting. If it's a property that isn't secure, you ordinarily use only the `properties` of the resource. The following example template deploys an Azure Functions application, and uses the access details (*instrumentation key*) for an Application Insights instance that was already created:
79+
The way that you access the information about a resource depends on the type of information you're getting. If it's a property that isn't secure, you ordinarily use only the `properties` of the resource. The following example template deploys an Azure Functions application and uses the access details (*instrumentation key*) for an existing Application Insights instance:
8080

8181
:::code language="bicep" source="code/6-existing-properties.bicep" highlight="1-3,15":::
8282

8383
In this example, because the instrumentation key isn't considered sensitive data, it's available in the `properties` of the resource. When you need to access secure data, such as the credentials to use to access a resource, use the `listKeys()` function, as shown in the following code:
8484

8585
:::code language="bicep" source="code/6-existing-listkeys.bicep" highlight="1-3,15":::
8686

87-
Notice that the `listKeys` function returns a `keys` array. The Bicep code retrieves the `value` property from the first item in the `keys` array. Each resource type has different information available from the `listKeys()` function. The Bicep extension for Visual Studio Code gives you hints to help you to understand the data that each resource's `listKeys()` function returns. The following screenshot shows the `listKeys()` function's output for a storage account:
87+
Notice that the `listKeys` function returns a `keys` array. The Bicep code retrieves the `value` property from the first item in the `keys` array. For each resource type, different information is available from the `listKeys()` function. The Bicep extension for Visual Studio Code gives you hints to help you to understand the data that each resource's `listKeys()` function returns. The following screenshot shows the `listKeys()` function's output for a storage account:
8888

89-
:::image type="content" source="../media/6-code-hint-listkeys-storage.png" alt-text="Screenshot of the Bicep extension for Visual Studio Code. IntelliSense displays several the information returned by the listKeys function for a storage account." border="true":::
89+
:::image type="content" source="../media/6-code-hint-listkeys-storage.png" alt-text="Screenshot of the Bicep extension for Visual Studio Code. IntelliSense displays the information returned by the listKeys function for a storage account." border="true" lightbox="../media/6-code-hint-listkeys-storage.png":::
9090

91-
Some resources support other functions, too. Visual Studio Code's IntelliSense lists the functions available for each resource. In the following screenshot, you can see that storage accounts provide functions named `listAccountSas()` and `listServiceSas()` in addition to `listKeys()`:
91+
Some resources also support other functions. Visual Studio Code IntelliSense lists the functions available for each resource. In the following screenshot, you can see that storage accounts provide functions named `listAccountSas()` and `listServiceSas()` in addition to `listKeys()`:
9292

93-
:::image type="content" source="../media/6-code-hint-functions.png" alt-text="Screenshot of the Bicep extension for Visual Studio Code. IntelliSense displays several functions available for the storage account." border="true":::
93+
:::image type="content" source="../media/6-code-hint-functions.png" alt-text="Screenshot of the Bicep extension for Visual Studio Code. IntelliSense displays several functions available for a storage account." border="true" lightbox="../media/6-code-hint-functions.png":::
9494

9595
> [!IMPORTANT]
9696
> The `listKeys()` function provides access to sensitive data about the resource. This means that the user or service principal that runs the deployment needs to have the appropriate level of permission on the resource. This is usually the *Contributor* built-in role, or a custom role that assigns the appropriate permission.

0 commit comments

Comments
 (0)