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/build-first-bicep-file/9-knowledge-check.yml
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -20,36 +20,36 @@ quiz:
20
20
choices:
21
21
- content: Create a Bicep file that deploys all of the resources for the manufacturing application. Add template parameters for the values that might change between environments.
22
22
isCorrect: true
23
-
explanation: Correct. File parameters are a great way to manage multiple environments. You can specify different values for the parameters when you deploy the file into the test and production environments.
23
+
explanation: Correct. Bicep file parameters are a great way to manage multiple environments. You can specify different values for the parameters when you deploy the file into the test and production environments.
24
24
- content: Create a module that deploys all of the resources for the manufacturing application. Create separate Bicep files for each environment, and add the shared module to each environment's file.
25
25
isCorrect: false
26
26
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.
27
-
- content: Create a file that deploys all of the resources required for the manufacturing application. Add variables for the values that might change between environments.
27
+
- content: Create a Bicep file that deploys all of the resources required for the manufacturing application. Add variables for the values that might change between environments.
28
28
isCorrect: false
29
29
explanation: Incorrect. Variables have the same value, so you don't usually need to consider them when you deploy multiple environments.
30
30
- content: |
31
-
The file that the team has developed includes this line:<br />
31
+
The Bicep file that the team has developed includes this line:<br />
- content: Whoever deploys the file must specify a value for the `siteName` parameter.
35
+
- content: Whoever deploys the Bicep file must specify a value for the `siteName` parameter.
36
36
isCorrect: false
37
37
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.
38
-
- content: The `siteName` parameter will have a different default value every time the file is deployed.
38
+
- content: The `siteName` parameter will have a different default value every time the Bicep file is deployed.
39
39
isCorrect: false
40
-
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 file is deployed in the same resource group in the same Azure subscription.
41
-
- content: When the file is deployed to the same resource group in the same subscription repeatedly, the `siteName` parameter's default value will be the same each time.
40
+
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 Bicep file is deployed in the same resource group in the same Azure subscription.
41
+
- content: When the Bicep file is deployed to the same resource group in the same subscription repeatedly, the `siteName` parameter's default value will be the same each time.
42
42
isCorrect: true
43
-
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 file is deployed in the same resource group in the same Azure subscription.
43
+
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 Bicep file is deployed in the same resource group in the same Azure subscription.
44
44
- content: The Bicep file that the IT department wrote has two modules in it. Which of these statements is true?
45
45
choices:
46
-
- content: If an output is added to one of the modules, it's automatically published as an output from the parent file too.
46
+
- content: If an output is added to one of the modules, it's automatically published as an output from the parent Bicep file too.
47
47
isCorrect: false
48
-
explanation: Incorrect. Outputs that Bicep modules define are available to the parent file, but they aren't automatically available to the file deployer. However, you can define an output in your file and pass the value through.
49
-
- content: If an output is added to one of the modules, it will automatically be available for the parent file to use.
48
+
explanation: Incorrect. Outputs that Bicep modules define are available to the parent Bicep file, but they aren't automatically available to the file deployer. However, you can define an output in your Bicep file, and pass the value through.
49
+
- content: If an output is added to one of the modules, it will automatically be available for the parent Bicep file to use.
50
50
isCorrect: true
51
-
explanation: Correct. The outputs from modules are automatically made available for the parent file to use, such as in defining input parameter values for other modules or in setting the properties on resources.
52
-
- content: Modules can't have outputs; only files can.
51
+
explanation: Correct. The outputs from modules are automatically made available for the parent Bicep file to use, such as in defining input parameter values for other modules or in setting the properties on resources.
52
+
- content: Modules can't have outputs; only Bicep files can.
53
53
isCorrect: false
54
-
explanation: Incorrect. Modules can define outputs. The outputs from modules are automatically made available to the parent file.
54
+
explanation: Incorrect. Modules can define outputs. The outputs from modules are automatically made available to the parent Bicep file.
Copy file name to clipboardExpand all lines: learn-pr/azure/build-first-bicep-file/includes/1-introduction.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,17 +8,17 @@ You'll host the website in Azure using Azure App Service. You'll incorporate a s
8
8
9
9
:::image type="content" source="../media/1-architecture-diagram.png" alt-text="Architecture diagram that shows a resource group containing an App Service plan, App Service app, and storage account." border="false":::
10
10
11
-
You decide to build the resources using infrastructure as code (IaC) techniques so you can reuse the file for future product launches.
11
+
You decide to build the resources using infrastructure as code (IaC) techniques so you can reuse the Bicep file for future product launches.
12
12
13
13
## What will we learn?
14
14
15
15
In this module, you'll create a reusable Bicep file to deploy a set of Azure resources for new product launches. You'll use many elements of the Bicep language, including:
16
16
17
17
- Resource definitions to deploy your Azure resources from your Bicep code.
18
-
- Parameters to make your file reusable.
19
-
- Variables and expressions to make it easier to write and deploy your file.
20
-
- Modules to help structure your file into multiple files.
21
-
- Outputs to send data from your file and modules back to whoever or whatever is deploying your infrastructure.
18
+
- Parameters to make your Bicep file reusable.
19
+
- Variables and expressions to make it easier to write and deploy your Bicep file.
20
+
- Modules to help structure your Bicep file into multiple files.
21
+
- Outputs to send data from your Bicep file and modules back to whoever or whatever is deploying your infrastructure.
Copy file name to clipboardExpand all lines: learn-pr/azure/build-first-bicep-file/includes/3-define-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
@@ -41,13 +41,13 @@ Let's look closely at some key parts of this resource definition:
41
41
- You'll then set other details of the resource, such as its location, SKU (pricing tier), and kind. There are also properties you can define that are different for each resource type. Different API versions might introduce different properties, too. In this example, we're setting the storage account's access tier to `Hot`.
42
42
43
43
> [!TIP]
44
-
> Resource names often have rules you must follow, like maximum lengths, allowed characters, and uniqueness across all of Azure. The requirements for resource names are different for each Azure resource type. Be sure to understand the naming restrictions and requirements before you add them to your file.
44
+
> Resource names often have rules you must follow, like maximum lengths, allowed characters, and uniqueness across all of Azure. The requirements for resource names are different for each Azure resource type. Be sure to understand the naming restrictions and requirements before you add them to your Bicep file.
45
45
46
46
## What happens when resources depend on each other?
47
47
48
48
A Bicep file usually includes several resources. Often, you need a resource to depend on another resource. You might have to extract some information from one resource to be able to define another. If you're deploying a web application, you'll have to create the server infrastructure before you can add an application to it. These relationships are called _dependencies_.
49
49
50
-
You'll need to deploy an App Service app for the file that will help launch the toy product, but to create an App Service app, you first need to create an App Service plan. The App Service plan represents the server-hosting resources, and it's declared like this example:
50
+
You'll need to deploy an App Service app for the Bicep file that will help launch the toy product, but to create an App Service app, you first need to create an App Service plan. The App Service plan represents the server-hosting resources, and it's declared like this example:
This file instructs Azure to host the app on the plan you created. Notice that the plan's definition includes the App Service plan's symbolic name on this line: `serverFarmId: appServicePlan.id`. This line means that Bicep will get the App Service plan's _resource ID_ using the `id` property. It's effectively saying: _this app's server-farm ID is the ID of the App Service plan defined earlier_.
77
+
This Bicep file instructs Azure to host the app on the plan you created. Notice that the plan's definition includes the App Service plan's symbolic name on this line: `serverFarmId: appServicePlan.id`. This line means that Bicep will get the App Service plan's _resource ID_ using the `id` property. It's effectively saying: _this app's server-farm ID is the ID of the App Service plan defined earlier_.
78
78
79
79
> [!TIP]
80
80
> In Azure, a _resource ID_ is a unique identifier for each resource. The resource ID includes the Azure subscription ID, the resource group name, and the resource name, along with some other information.
Copy file name to clipboardExpand all lines: learn-pr/azure/build-first-bicep-file/includes/4-exercise-define-resources-bicep-file.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ During the process, you'll:
6
6
7
7
> [!div class="checklist"]
8
8
>
9
-
> - Create a file that defines a single storage account resource that includes hard-coded values.
9
+
> - Create a Bicep file that defines a single storage account resource that includes hard-coded values.
10
10
> - Provision your infrastructure and verify the result.
11
-
> - Add an App Service plan and app to the file.
11
+
> - Add an App Service plan and app to the Bicep file.
12
12
> - Provision the infrastructure again to see the new resources.
13
13
14
14
[!INCLUDE [Install the Bicep extension for Visual Studio Code](../../includes/azure-template-bicep-exercise-vscode-extension.md)]
@@ -17,20 +17,20 @@ During the process, you'll:
17
17
18
18
1. Open Visual Studio Code.
19
19
20
-
1. Create a new file called _main.bicep_.
20
+
1. Create a new Bicep file called _main.bicep_.
21
21
22
22
1. Save the empty file so that Visual Studio Code loads the Bicep tooling.
23
23
24
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've saved the file. For example, you might want to create a _files_ folder in which to save the file.
25
25
26
-
1. Add the following Bicep code into the file. You'll deploy the file soon. It's a good idea to type the code yourself instead of copying and pasting so you can see how the tooling helps you to write your Bicep files.
26
+
1. Add the following Bicep code into the Bicep file. You'll deploy the file soon. It's a good idea to type the code yourself instead of copying and pasting so you can see how the tooling helps you to write your Bicep files.
> Bicep is strict about where you put line breaks, so make sure you don't put line breaks in different places than listed here.
32
32
33
-
Notice that Visual Studio Code automatically suggests property names as you type. The Bicep extension for Visual Studio Code understands the resources you're defining in your file, and it lists the available properties and values that you can use.
33
+
Notice that Visual Studio Code automatically suggests property names as you type. The Bicep extension for Visual Studio Code understands the resources you're defining in your Bicep file, and it lists the available properties and values that you can use.
34
34
35
35
1. Update the name of the storage account from `toylaunchstorage` to something that's likely to be unique, because every storage account needs a globally unique name. Make sure the name is 3 to 24 characters and includes only lowercase letters and numbers.
36
36
@@ -45,7 +45,7 @@ During the process, you'll:
45
45
46
46
[!INCLUDE [Bootstrapping instructions for first Bicep exercise - CLI](../../includes/azure-template-bicep-exercise-sandbox-deploy-cli.md)]
47
47
48
-
### Deploy the file to Azure
48
+
### Deploy the Bicep file to Azure
49
49
50
50
Run the following command from the terminal in Visual Studio Code to deploy the Bicep file to Azure. The command can take a minute or two to complete, and then you'll see a successful deployment. If you see a warning about the location being hard-coded, you can ignore it. You'll fix the location later in the module. It's safe to proceed and the deployment will succeed.
51
51
@@ -61,9 +61,9 @@ You'll see `Running...` in the terminal.
61
61
62
62
[!INCLUDE [Bootstrapping instructions for first Bicep exercise - PowerShell](../../includes/azure-template-bicep-exercise-sandbox-deploy-powershell.md)]
63
63
64
-
### Deploy the file to Azure
64
+
### Deploy the Bicep file to Azure
65
65
66
-
Deploy the file to Azure by using the following Azure PowerShell command in the terminal. The command can take a minute or two to complete, and you'll see a successful deployment. If you see a warning about the location being hard-coded, you can ignore it. You'll fix the location later in the module. It's safe to proceed and the deployment will succeed.
66
+
Deploy the Bicep file to Azure by using the following Azure PowerShell command in the terminal. The command can take a minute or two to complete, and you'll see a successful deployment. If you see a warning about the location being hard-coded, you can ignore it. You'll fix the location later in the module. It's safe to proceed and the deployment will succeed.
67
67
68
68
```azurepowershell
69
69
New-AzResourceGroupDeployment -Name main -TemplateFile main.bicep
@@ -120,7 +120,7 @@ Get-AzResourceGroupDeployment -ResourceGroupName <rgn>[sandbox resource group na
120
120
121
121
## Add an App Service plan and app to your Bicep file
122
122
123
-
In the previous task, you learned how to create a file that contains a single resource and deploy it. Now you're ready to deploy more resources, including a dependency. In this task, you'll add an App Service plan and app to the Bicep file.
123
+
In the previous task, you learned how to create a Bicep file that contains a single resource and deploy it. Now you're ready to deploy more resources, including a dependency. In this task, you'll add an App Service plan and app to the Bicep file.
124
124
125
125
1. In the _main.bicep_ file in Visual Studio Code, add the following code to the bottom of the file:
0 commit comments