Skip to content

Commit bf14005

Browse files
authored
Merge pull request #52995 from MicrosoftDocs/UPDATE-build-first-bicep-file
UPDATE: Removing sandbox from build-first-bicep-file
2 parents 0935fbc + 508af93 commit bf14005

18 files changed

Lines changed: 1062 additions & 1053 deletions
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.deploy-azure-resources-bicep.introduction
3-
title: Introduction
4-
metadata:
5-
unitType: introduction
6-
title: Introduction
7-
description: Learn how to create Bicep files and reusable infrastructure as 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.deploy-azure-resources-bicep.introduction
3+
title: Introduction
4+
metadata:
5+
unitType: introduction
6+
title: Introduction
7+
description: Learn how to create Bicep files and reusable infrastructure as 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+
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.deploy-azure-resources-bicep.define-resources
3-
title: Define resources
4-
metadata:
5-
unitType: learning-content
6-
title: Define Azure resources in a Bicep file
7-
description: Learn how to define resources in Bicep, and understand how Bicep treats dependencies between resources.
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: 5
15-
content: |
16-
[!include[](includes/3-define-resources.md)]
17-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.deploy-azure-resources-bicep.define-resources
3+
title: Define resources
4+
metadata:
5+
unitType: learning-content
6+
title: Define Azure resources in a Bicep file
7+
description: Learn how to define resources in Bicep, and understand how Bicep treats dependencies between resources.
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: 5
15+
content: |
16+
[!include[](includes/3-define-resources.md)]
17+
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.deploy-azure-resources-bicep.define-resources-bicep-file
3-
title: Exercise - Define resources in a Bicep file
4-
sandbox: true
5-
metadata:
6-
unitType: exercise
7-
title: Exercise - Define resources in a Bicep file
8-
description: Learn how to define resources in Bicep and understand how Bicep treats dependencies between resources.
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: 12
16-
content: |
17-
[!include[](includes/4-exercise-define-resources-bicep-file.md)]
18-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.deploy-azure-resources-bicep.define-resources-bicep-file
3+
title: Exercise - Define resources in a Bicep file
4+
#sandbox: true
5+
metadata:
6+
unitType: exercise
7+
title: Exercise - Define resources in a Bicep file
8+
description: Learn how to define resources in Bicep and understand how Bicep treats dependencies between resources.
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: 12
16+
content: |
17+
[!include[](includes/4-exercise-define-resources-bicep-file.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.deploy-azure-resources-bicep.add-flexibility-parameters-variables
3-
title: Add flexibility by using parameters and variables
4-
metadata:
5-
unitType: learning-content
6-
title: Add flexibility by using parameters and variables
7-
description: Learn how to build reusable Bicep files by using parameters to accept input and variables to store and reuse values within the file.
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: 10
15-
content: |
16-
[!include[](includes/5-add-flexibility-parameters-variables.md)]
17-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.deploy-azure-resources-bicep.add-flexibility-parameters-variables
3+
title: Add flexibility by using parameters and variables
4+
metadata:
5+
unitType: learning-content
6+
title: Add flexibility by using parameters and variables
7+
description: Learn how to build reusable Bicep files by using parameters to accept input and variables to store and reuse values within the file.
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: 10
15+
content: |
16+
[!include[](includes/5-add-flexibility-parameters-variables.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.deploy-azure-resources-bicep.add-parameters-variables-bicep-file
3-
title: Exercise - Add parameters and variables to your Bicep file
4-
sandbox: true
5-
metadata:
6-
unitType: exercise
7-
title: Exercise - Add parameters and variables to your Bicep file
8-
description: Learn how to build reusable Bicep files by using parameters to accept input and variables to store and reuse values within the file.
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: 7
17-
content: |
18-
[!include[](includes/6-exercise-add-parameters-variables-bicep-file.md)]
19-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.deploy-azure-resources-bicep.add-parameters-variables-bicep-file
3+
title: Exercise - Add parameters and variables to your Bicep file
4+
#sandbox: true
5+
metadata:
6+
unitType: exercise
7+
title: Exercise - Add parameters and variables to your Bicep file
8+
description: Learn how to build reusable Bicep files by using parameters to accept input and variables to store and reuse values within the file.
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: 7
17+
content: |
18+
[!include[](includes/6-exercise-add-parameters-variables-bicep-file.md)]
19+
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.deploy-azure-resources-bicep.refactor-file-modules
3-
title: Exercise - Refactor your Bicep file to use modules
4-
sandbox: true
5-
metadata:
6-
unitType: exercise
7-
title: Exercise - Refactor your Bicep file to use modules
8-
description: Learn how to create self-contained, reusable modules for your Bicep code.
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: 8
17-
content: |
18-
[!include[](includes/8-exercise-refactor-file-modules.md)]
19-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.deploy-azure-resources-bicep.refactor-file-modules
3+
title: Exercise - Refactor your Bicep file to use modules
4+
#sandbox: true
5+
metadata:
6+
unitType: exercise
7+
title: Exercise - Refactor your Bicep file to use modules
8+
description: Learn how to create self-contained, reusable modules for your Bicep code.
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: 8
17+
content: |
18+
[!include[](includes/8-exercise-refactor-file-modules.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.deploy-azure-resources-bicep.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-
module_assessment: true
15-
durationInMinutes: 3
16-
content: |
17-
[!include[](includes/9-knowledge-check.md)]
18-
quiz:
19-
questions:
20-
- content: What's the best way for the team to create a template that deploys to both test and production environments?
21-
choices:
22-
- content: Create a template that deploys all of the resources for the manufacturing application. Add template parameters for the values that might change between environments.
23-
isCorrect: true
24-
explanation: Correct. Template parameters are a great way to manage multiple environments. You can specify different values for the parameters when you deploy the template into the test and production environments.
25-
- content: Create a module that deploys all of the resources for the manufacturing application. Create separate Bicep templates for each environment, and add the shared module to each environment's template.
26-
isCorrect: false
27-
explanation: Incorrect. Modules can be a great way to reuse your Bicep code, but when you're deploying multiple environments, there's usually a simpler way to keep track of the different configurations for each deployment.
28-
- content: Create a template that deploys all of the resources required for the manufacturing application. Add variables for the values that might change between environments.
29-
isCorrect: false
30-
explanation: Incorrect. Variables have the same value, so you don't usually need to consider them when you deploy multiple environments.
31-
- content: |
32-
The template that the team has developed includes this line:<br />
33-
`param siteName string = 'mysite-${uniqueString(resourceGroup().id)}'`<br />
34-
Which of these statements is true?
35-
choices:
36-
- content: Whoever deploys the template must specify a value for the `siteName` parameter.
37-
isCorrect: false
38-
explanation: Incorrect. The `siteName` parameter has a _default value_ specified, which means that deployments don't have to specify the parameter value. If they don't, the parameter's default value is used.
39-
- content: The `siteName` parameter will have a different default value every time the template is deployed.
40-
isCorrect: false
41-
explanation: Incorrect. The parameter's default value is set through the `uniqueString()` function, which has been seeded with the resource group's ID. Therefore, the value that the `uniqueString()` function returns is the same whenever the template is deployed in the same resource group in the same Azure subscription.
42-
- content: When the template is deployed to the same resource group in the same subscription repeatedly, the `siteName` parameter's default value will be the same each time.
43-
isCorrect: true
44-
explanation: Correct. The `siteName` parameter's default value uses string interpolation to combine the string prefix `mysite-` with a value from the `uniqueString()` function, which is seeded with the resource group ID. The value that the `uniqueString()` function returns is the same whenever the template is deployed in the same resource group in the same Azure subscription.
45-
- content: The Bicep template that the IT department wrote has two modules in it. Which of these statements is true?
46-
choices:
47-
- content: If an output is added to one of the modules, it's automatically published as an output from the parent template too.
48-
isCorrect: false
49-
explanation: Incorrect. Outputs that Bicep modules define are available to the parent template, but they aren't automatically available to the template deployer. However, you can define an output in your template and pass the value through.
50-
- content: If an output is added to one of the modules, it will automatically be available for the parent template to use.
51-
isCorrect: true
52-
explanation: Correct. The outputs from modules are automatically made available for the parent template to use, such as in defining input parameter values for other modules or in setting the properties on resources.
53-
- content: Modules can't have outputs; only templates can.
54-
isCorrect: false
55-
explanation: Incorrect. Modules can define outputs. The outputs from modules are automatically made available to the parent template.
56-
1+
### YamlMime:ModuleUnit
2+
uid: learn.azure.deploy-azure-resources-bicep.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+
module_assessment: true
15+
durationInMinutes: 3
16+
content: |
17+
[!include[](includes/9-knowledge-check.md)]
18+
quiz:
19+
questions:
20+
- content: What's the best way for the team to create a template that deploys to both test and production environments?
21+
choices:
22+
- content: Create a template that deploys all of the resources for the manufacturing application. Add template parameters for the values that might change between environments.
23+
isCorrect: true
24+
explanation: Correct. Template parameters are a great way to manage multiple environments. You can specify different values for the parameters when you deploy the template into the test and production environments.
25+
- content: Create a module that deploys all of the resources for the manufacturing application. Create separate Bicep templates for each environment, and add the shared module to each environment's template.
26+
isCorrect: false
27+
explanation: Incorrect. Modules can be a great way to reuse your Bicep code, but when you're deploying multiple environments, there's usually a simpler way to keep track of the different configurations for each deployment.
28+
- content: Create a template that deploys all of the resources required for the manufacturing application. Add variables for the values that might change between environments.
29+
isCorrect: false
30+
explanation: Incorrect. Variables have the same value, so you don't usually need to consider them when you deploy multiple environments.
31+
- content: |
32+
The template that the team has developed includes this line:<br />
33+
`param siteName string = 'mysite-${uniqueString(resourceGroup().id)}'`<br />
34+
Which of these statements is true?
35+
choices:
36+
- content: Whoever deploys the template must specify a value for the `siteName` parameter.
37+
isCorrect: false
38+
explanation: Incorrect. The `siteName` parameter has a _default value_ specified, which means that deployments don't have to specify the parameter value. If they don't, the parameter's default value is used.
39+
- content: The `siteName` parameter will have a different default value every time the template is deployed.
40+
isCorrect: false
41+
explanation: Incorrect. The parameter's default value is set through the `uniqueString()` function, which has been seeded with the resource group's ID. Therefore, the value that the `uniqueString()` function returns is the same whenever the template is deployed in the same resource group in the same Azure subscription.
42+
- content: When the template is deployed to the same resource group in the same subscription repeatedly, the `siteName` parameter's default value will be the same each time.
43+
isCorrect: true
44+
explanation: Correct. The `siteName` parameter's default value uses string interpolation to combine the string prefix `mysite-` with a value from the `uniqueString()` function, which is seeded with the resource group ID. The value that the `uniqueString()` function returns is the same whenever the template is deployed in the same resource group in the same Azure subscription.
45+
- content: The Bicep template that the IT department wrote has two modules in it. Which of these statements is true?
46+
choices:
47+
- content: If an output is added to one of the modules, it's automatically published as an output from the parent template too.
48+
isCorrect: false
49+
explanation: Incorrect. Outputs that Bicep modules define are available to the parent template, but they aren't automatically available to the template deployer. However, you can define an output in your template and pass the value through.
50+
- content: If an output is added to one of the modules, it will automatically be available for the parent template to use.
51+
isCorrect: true
52+
explanation: Correct. The outputs from modules are automatically made available for the parent template to use, such as in defining input parameter values for other modules or in setting the properties on resources.
53+
- content: Modules can't have outputs; only templates can.
54+
isCorrect: false
55+
explanation: Incorrect. Modules can define outputs. The outputs from modules are automatically made available to the parent template.
56+

0 commit comments

Comments
 (0)