Skip to content

Commit 6c9c0bd

Browse files
committed
updates2
1 parent d39ed38 commit 6c9c0bd

File tree

11 files changed

+87
-87
lines changed

11 files changed

+87
-87
lines changed

learn-pr/azure/build-flexible-bicep-templates-conditions-loops/1-introduction.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Introduction
44
metadata:
55
unitType: introduction
66
title: Introduction
7-
description: Learn how to build flexible Bicep templates by using conditions and loops.
7+
description: Learn how to build flexible Bicep files by using conditions and loops.
88
ms.date: 04/18/2025
99
author: mumian
1010
ms.author: jgao

learn-pr/azure/build-flexible-bicep-templates-conditions-loops/9-knowledge-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ quiz:
2323
- content: Define a resource for the policy assignment by using the *audit* effect, and ignore any errors for non-production environments.
2424
isCorrect: false
2525
explanation: Incorrect. It's not good practice to ignore policy violations. Instead, you should conditionally deploy the policy assignment so that it's only for your production environments.
26-
- content: Add a condition to your Bicep template so that the policy assignment is deployed only when the `environmentName` parameter value is set to `Production`.
26+
- content: Add a condition to your Bicep file so that the policy assignment is deployed only when the `environmentName` parameter value is set to `Production`.
2727
isCorrect: true
2828
explanation: Correct. By using a condition with your resource declaration, you'll assign the policy only to environments that need it.
2929
- content: Move the policy assignment into its own module.
@@ -44,7 +44,7 @@ quiz:
4444
choices:
4545
- content: Use the `copyIndex()` function.
4646
isCorrect: false
47-
explanation: Incorrect. The `copyIndex()` function is used within JSON templates, not within Bicep templates.
47+
explanation: Incorrect. The `copyIndex()` function is used within JSON templates, not within Bicep files.
4848
- content: Use array functions.
4949
isCorrect: false
5050
explanation: Incorrect. Array functions are often useful when you're working with loops, but they don't let you access the current item.

learn-pr/azure/build-flexible-bicep-templates-conditions-loops/includes/1-introduction.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
When you work with Bicep templates, conditions and loops can help make your Azure deployments more flexible. With conditions, you can deploy resources only when specific constraints are in place. And with loops, you can deploy multiple resources that have similar properties.
1+
When you work with Bicep files, conditions and loops can help make your Azure deployments more flexible. With conditions, you can deploy resources only when specific constraints are in place. And with loops, you can deploy multiple resources that have similar properties.
22

33
## Example scenario
44

@@ -10,7 +10,7 @@ You expect that the toy will be very popular, and your company plans to launch i
1010

1111
## What will we learn?
1212

13-
In this module, you'll extend a Bicep template by using conditions and loops. You'll:
13+
In this module, you'll extend a Bicep file by using conditions and loops. You'll:
1414

1515
- Use *conditions* to deploy Azure resources only when they're required.
1616
- Use *loops* to deploy multiple instances of Azure resources.
@@ -20,13 +20,13 @@ In this module, you'll extend a Bicep template by using conditions and loops. Yo
2020

2121
## What is the main goal?
2222

23-
By the end of this module, you'll be able to create Bicep templates by using conditions and loops, and write Bicep code that configures how loops are executed. You'll also be able to create variable loops and output loops to make your templates even more flexible.
23+
By the end of this module, you'll be able to create Bicep files by using conditions and loops, and write Bicep code that configures how loops are executed. You'll also be able to create variable loops and output loops to make your templates even more flexible.
2424

2525
## Prerequisites
2626

2727
You should be familiar with:
2828

29-
- Creating and deploying basic Bicep templates, including modules.
29+
- Creating and deploying basic Bicep files, including modules.
3030
- Azure, including the Azure portal, subscriptions, resource groups, and resource definitions.
3131

3232
To follow along with the exercises in the module, you'll need:

learn-pr/azure/build-flexible-bicep-templates-conditions-loops/includes/10-summary.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Your toy company wants to launch a new teddy bear toy in multiple countries/regions. For compliance reasons, the infrastructure must be spread across all the Azure regions where the toy will be launched.
22

3-
You needed to deploy the same resources in multiple locations and a variety of environments. You wanted to create flexible Bicep templates that you can reuse, and to control resource deployments by changing the deployment parameters.
3+
You needed to deploy the same resources in multiple locations and a variety of environments. You wanted to create flexible Bicep files that you can reuse, and to control resource deployments by changing the deployment parameters.
44

55
To deploy some resources only to certain environments, you added conditions to your template. You then used copy loops to deploy resources into various Azure regions. You used variable loops to define the properties of the resources to be deployed. Finally, you used output loops to retrieve the properties of those deployed resources.
66

7-
Without the conditions and copy loops features, you'd have to maintain and use multiple versions of Bicep templates. You'd have to apply every change in your environment in multiple templates. Maintaining all these templates would entail a great deal of effort and overhead. By using conditions and loops, you were able to create a single template that works for all your regions and environments and ensure that all your resources are configured identically.
7+
Without the conditions and copy loops features, you'd have to maintain and use multiple versions of Bicep files. You'd have to apply every change in your environment in multiple templates. Maintaining all these templates would entail a great deal of effort and overhead. By using conditions and loops, you were able to create a single template that works for all your regions and environments and ensure that all your resources are configured identically.
88

99
## Learn more
1010

learn-pr/azure/build-flexible-bicep-templates-conditions-loops/includes/3-exercise-conditions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ During the process, you'll:
1414
1515
[!INCLUDE [Install the Bicep extension for Visual Studio Code](../../includes/azure-template-bicep-exercise-vscode-extension.md)]
1616

17-
## Create a Bicep template with a logical server and database
17+
## Create a Bicep file with a logical server and database
1818

1919
1. Open Visual Studio Code.
2020

@@ -70,15 +70,15 @@ After you've completed all of the preceding changes, your Bicep file should look
7070

7171
If it doesn't, either copy the example or adjust your template to match the example.
7272

73-
## Deploy the Bicep template to Azure
73+
## Deploy the Bicep file to Azure
7474

7575
::: zone pivot="cli"
7676

7777
[!INCLUDE [Bootstrapping instructions for first Bicep exercise - CLI](../../includes/azure-template-bicep-exercise-sandbox-deploy-cli.md)]
7878

7979
### Deploy the template to Azure by using the Azure CLI
8080

81-
In the Visual Studio Code terminal, deploy the Bicep template to Azure by running the following code. Notice that you're explicitly setting the `location` parameter to `westus3`.
81+
In the Visual Studio Code terminal, deploy the Bicep file to Azure by running the following code. Notice that you're explicitly setting the `location` parameter to `westus3`.
8282

8383
```azurecli
8484
az deployment group create --name main --template-file main.bicep --parameters location=westus3
@@ -158,7 +158,7 @@ Now you'll explicitly set the parameter value to `Production`. You expect that,
158158

159159
::: zone pivot="cli"
160160

161-
In the Visual Studio Code terminal, deploy the Bicep template to Azure by running the following code:
161+
In the Visual Studio Code terminal, deploy the Bicep file to Azure by running the following code:
162162

163163
```azurecli
164164
az deployment group create --name main --template-file main.bicep --parameters environmentName=Production location=westus3

learn-pr/azure/build-flexible-bicep-templates-conditions-loops/includes/4-use-loops-deploy-resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ In this unit, you learn how to deploy multiple instances of resources by using _
1010

1111
## Use copy loops
1212

13-
When you define a resource or a module in a Bicep template, you can use the `for` keyword to create a loop. Place the `for` keyword in the resource declaration, then specify how you want Bicep to identify each item in the loop. Typically, you loop over an array of objects to create multiple instances of a resource. The following example deploys multiple storage accounts, and their names are specified as parameter values:
13+
When you define a resource or a module in a Bicep file, you can use the `for` keyword to create a loop. Place the `for` keyword in the resource declaration, then specify how you want Bicep to identify each item in the loop. Typically, you loop over an array of objects to create multiple instances of a resource. The following example deploys multiple storage accounts, and their names are specified as parameter values:
1414

1515
::: code language="bicep" source="code/4-loop-simple.bicep" highlight="7-8, 14" :::
1616

learn-pr/azure/build-flexible-bicep-templates-conditions-loops/includes/5-exercise-loops.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
So far, your Bicep template has deployed a single Azure SQL logical server, with auditing settings included for your production environment. You now need to deploy multiple logical servers, one for each region where your company is launching its new smart teddy bear.
1+
So far, your Bicep file has deployed a single Azure SQL logical server, with auditing settings included for your production environment. You now need to deploy multiple logical servers, one for each region where your company is launching its new smart teddy bear.
22

33
In this exercise, you'll extend the Bicep code that you created previously so that you can deploy instances of your databases to multiple Azure regions.
44

@@ -46,11 +46,11 @@ Your *database.bicep* file should look like this example:
4646

4747
If it doesn't, either copy the example or adjust your template to match the example.
4848

49-
## Deploy the Bicep template to Azure
49+
## Deploy the Bicep file to Azure
5050

5151
::: zone pivot="cli"
5252

53-
In the Visual Studio Code terminal, deploy the Bicep template to Azure by running the following code:
53+
In the Visual Studio Code terminal, deploy the Bicep file to Azure by running the following code:
5454

5555
```azurecli
5656
az deployment group create --name main --template-file main.bicep
@@ -60,7 +60,7 @@ az deployment group create --name main --template-file main.bicep
6060

6161
::: zone pivot="powershell"
6262

63-
In the Visual Studio Code terminal, deploy the Bicep template to Azure by running the following Azure PowerShell command:
63+
In the Visual Studio Code terminal, deploy the Bicep file to Azure by running the following Azure PowerShell command:
6464

6565
```azurepowershell
6666
New-AzResourceGroupDeployment -Name main -TemplateFile main.bicep

learn-pr/azure/build-flexible-bicep-templates-conditions-loops/includes/7-use-loops-with-variables-and-outputs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
You've learned how you can use copy loops to deploy multiple instances of resources and how to set the properties of a resource by using loops. In Bicep, you can also use loops with variables and outputs.
22

3-
For your toy company, you need to deploy virtual networks with the same subnet configuration across multiple Azure regions. You expect that you'll need to add additional subnets to your virtual networks in the future, so you want to have the flexibility in your Bicep templates to modify the subnet configuration.
3+
For your toy company, you need to deploy virtual networks with the same subnet configuration across multiple Azure regions. You expect that you'll need to add additional subnets to your virtual networks in the future, so you want to have the flexibility in your Bicep files to modify the subnet configuration.
44

55
Because you'll also be deploying multiple storage accounts in your Azure environment, you need to provide the endpoints for each storage account as output so that your deployment pipelines can use this information.
66

learn-pr/azure/build-flexible-bicep-templates-conditions-loops/includes/8-exercise-loops-variables-outputs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ Your *database.bicep* file should look like this example:
7373

7474
If they don't, either copy the examples or adjust your templates to match the examples.
7575

76-
## Deploy the Bicep template to Azure
76+
## Deploy the Bicep file to Azure
7777

7878
::: zone pivot="cli"
7979

80-
In the Visual Studio Code terminal, deploy the Bicep template to Azure by running the following code. This process can take a couple of minutes to finish, and then you'll have a successful deployment.
80+
In the Visual Studio Code terminal, deploy the Bicep file to Azure by running the following code. This process can take a couple of minutes to finish, and then you'll have a successful deployment.
8181

8282
```azurecli
8383
az deployment group create --name main --template-file main.bicep
@@ -87,7 +87,7 @@ az deployment group create --name main --template-file main.bicep
8787

8888
::: zone pivot="powershell"
8989

90-
In the Visual Studio Code terminal, deploy the Bicep template to Azure by running the following Azure PowerShell command. This process can take a couple of minutes to finish, and then you'll have a successful deployment.
90+
In the Visual Studio Code terminal, deploy the Bicep file to Azure by running the following Azure PowerShell command. This process can take a couple of minutes to finish, and then you'll have a successful deployment.
9191

9292
```azurepowershell
9393
New-AzResourceGroupDeployment -Name main -TemplateFile main.bicep

learn-pr/azure/build-flexible-bicep-templates-conditions-loops/index.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22
uid: learn.azure.bicep-conditions-loops
33
metadata:
44
moduleType: standard
5-
title: Build Flexible Bicep Templates by Using Conditions and Loops
6-
description: Build advanced Bicep templates by using conditions to conditionally deploy resources and using loops to deploy multiple instances of resources.
5+
title: Build Flexible Bicep files by Using Conditions and Loops
6+
description: Build advanced Bicep files by using conditions to conditionally deploy resources and using loops to deploy multiple instances of resources.
77
ms.service: azure-resource-manager
88
manager: jasongroce
99
ms.date: 04/18/2025
1010
author: mumian
1111
ms.author: jgao
1212
ms.topic: module
1313
ms.devlang: bicep
14-
title: Build flexible Bicep templates by using conditions and loops
14+
title: Build flexible Bicep files by using conditions and loops
1515
summary: |
1616
In this module, you'll deploy resources only when specific constraints are in place and use loops to deploy multiple resources that have similar properties.
1717
abstract: |
1818
After completing this module, you'll be able to:
19-
- Deploy resources conditionally within a Bicep template.
19+
- Deploy resources conditionally within a Bicep file.
2020
- Deploy multiple instances of resources by using loops.
2121
- Use output and variable loops.
2222
prerequisites: |
2323
You should be familiar with:
24-
- Creating and deploying basic Bicep templates, including modules.
24+
- Creating and deploying basic Bicep files, including modules.
2525
- Azure, including the Azure portal, subscriptions, resource groups, and resource definitions.
2626
2727
To follow along with the exercises in the module, you'll need:

0 commit comments

Comments
 (0)