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/test-bicep-code-using-azure-pipelines/includes/1-introduction.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ When you automate your Bicep deployments by using Azure Pipelines, you create a
2
2
3
3
In this module, you'll learn how to extend your pipeline to add validation, checks, and tests. By implementing verifications, you build confidence that your deployments meet your quality standards.
4
4
5
-
## Example scenario
5
+
## Module scenario
6
6
7
7
Suppose you're the Azure administrator at a toy company. You're working with your website team to create a Bicep template that deploys and configures the Azure resources for your company's main website. You're also creating a pipeline to deploy the Bicep file automatically.
Copy file name to clipboardExpand all lines: learn-pr/azure/test-bicep-code-using-azure-pipelines/includes/2-understand-pipeline-stages.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@ _Stages_ help you to divide your pipeline into multiple logical blocks. Each sta
6
6
7
7
:::image type="content" source="../media/2-stages.png" alt-text="Diagram that shows a pipeline with a stage containing one job. The job contains four steps." border="false":::
8
8
9
-
You can use stages in your pipeline to mark a separation of concerns. For example, when you work with Bicep code, _validating_ the code is a separate concern from _deploying_ your Bicep file. When you use an automated pipeline, building and testing your code are often called _continuous integration_ (CI). Deploying code in an automated pipeline is often called _continuous deployment_ (CD).
9
+
You can use stages in your pipeline to mark a separation of concerns. For example, when you work with Bicep code, validating the code is a separate concern from deploying your Bicep file. When you use an automated pipeline, building and testing your code are often called _continuous integration_ (CI). Deploying code in an automated pipeline is often called _continuous deployment_ (CD).
10
10
11
11
During CI stages, you check the validity of the changes that have been made to your code. CI stages provide quality assurance. You can run them without affecting your live production environment.
12
12
13
13
In many programming languages, code needs to be _built_ before someone can run it. When a Bicep file is deployed, it's converted, or _transpiled_, from Bicep to JSON. The tooling performs this process automatically. In most situations, you don't need to manually build Bicep code to JSON templates in your pipeline. We still use the term _continuous integration_ when we talk about Bicep code, though, because the other parts of CI still apply, such as validating your code.
14
14
15
-
After your CI stages run successfully, you should have increased your confidence that the changes you made will also deploy successfully. During CD stages, you deploy your code to each of your environments. You usually start with test and other nonproduction environments and move through to production environments. In this module, you'll deploy to a single environment. In a future module, you'll learn how to extend your deployment pipeline to deploy to multiple environments, such as nonproduction and production environments.
15
+
After your CI stages run successfully, you should have increased your confidence that the changes you made will also deploy successfully. During CD stages, you deploy your code to each of your environments. You usually start with test and other nonproduction environments and then continue to production environments. In this module, you'll deploy to a single environment. In a future module, you'll learn how to extend your deployment pipeline to deploy to multiple environments, such as nonproduction and production environments.
16
16
17
17
Stages run in a sequence. You can control how and when each stage runs. For example, you can configure your CD stages to run only after your CI stages run successfully. Or you might have multiple CI stages that need to run in sequence, for example, to build your code and then test it. You might also include a _rollback_ stage that runs only if previous deployment stages fail.
Copy file name to clipboardExpand all lines: learn-pr/azure/test-bicep-code-using-azure-pipelines/includes/3-lint-validate-bicep-code.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ Now that you know what pipeline stages are for, let's consider the first set of
2
2
3
3
## What's a valid Bicep file?
4
4
5
-
A valid Bicep file is one that doesn't contain any syntax errors. Also, the definitions for the Azure resources that you plan to deploy must be valid. And when the resources defined in the file are deployed, they stay within the quotas and limits that exist in your Azure subscription.
5
+
A valid Bicep file is one that doesn't contain any syntax errors. Also, the definitions for the Azure resources that you plan to deploy must be valid. And when the resources defined in the file are deployed, they must stay within the quotas and limits that exist in your Azure subscription.
6
6
7
7
Some of the checks are performed on your Bicep file in isolation, like the checks for syntax errors, for valid Azure resource definitions, and for code quality. These steps are part of a process called _linting_. To check for other problems, you need to request that the Azure Resource Manager service validates your template and takes your Azure environment into account.
8
8
@@ -20,9 +20,7 @@ A linter contains a predefined set of rules for each of these categories. Exampl
20
20
-**String interpolation**. The linter checks if your file uses the `concat()` function instead of Bicep string interpolation. String interpolation makes your Bicep files more readable.
21
21
-**Default values for secure parameters**. The linter warns you if you set default values for parameters that are marked with the `@secure()` decorator. A default value for a secure parameter is a bad practice because it gives the secure parameter a human-readable value, and people might not change it before deployment.
22
22
23
-
The Bicep linter runs automatically when you use the Bicep tooling. Every time you build a Bicep file, the linter checks it against its best practices. Linting happens automatically when you deploy a Bicep file to Azure.
24
-
25
-
But in a pipeline, you typically want to run the validation and linting steps before you deploy the file. You can configure Bicep to verify your file by manually building the Bicep file via the Bicep CLI:
23
+
The Bicep linter runs automatically when you use the Bicep tooling. Every time you build a Bicep file, the linter checks it against its best practices. Linting happens automatically when you deploy a Bicep file to Azure. But in a pipeline, you typically want to run the validation and linting steps before you deploy the file. You can configure Bicep to verify your file by manually building the Bicep file via the Bicep CLI:
26
24
27
25
::: zone pivot="cli"
28
26
@@ -53,7 +51,7 @@ You can express this addition in your pipeline YAML file like this:
53
51
54
52
### Linter warnings and errors
55
53
56
-
By default, the linter emits a warning when it discovers that a Bicep file has violated a rule. Warnings that the Bicep linter emits aren't treated as an error, so they won't stop the pipeline run or stop subsequent stages from running.
54
+
By default, the linter emits a warning when it discovers that a Bicep file has violated a rule. Warnings that the Bicep linter emits aren't treated as errors, so they won't stop the pipeline run or stop subsequent stages from running.
57
55
58
56
You can change this behavior by configuring Bicep to treat the linter rule violations as errors instead of warnings. You do this configuration by adding a _bicepconfig.json_ file to the folder that contains your Bicep file. You can decide which linter issues should be treated as errors and which should remain as warnings. You'll see how to update linter rules later in this module.
Copy file name to clipboardExpand all lines: learn-pr/azure/test-bicep-code-using-azure-pipelines/includes/4-exercise-set-up-environment.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ The modules in this learning path are part of a progression. Each module has an
23
23
24
24
Run a template that sets up your Azure DevOps organization.
25
25
26
-
1.[Get and run the ADOGenerator project](https://github.com/microsoft/AzDevOpsDemoGenerator/blob/main/docs/RunApplication.md) in Visual Studio or the IDE of your choice.
26
+
1.[Get and run the ADOGenerator project](https://github.com/microsoft/AzDevOpsDemoGenerator/blob/main/docs/RunApplication.md) in Visual Studio or another IDE.
27
27
28
28
1. When you're asked whether you want to create a new template or use the demo generator, enter **1** and then select **Enter**.
29
29
@@ -36,9 +36,9 @@ Run a template that sets up your Azure DevOps organization.
36
36
37
37
1. Enter your Azure DevOps organization name, and then select **Enter**.
38
38
39
-
1. If prompted, enter your Azure DevOps PAT, then select **Enter**.
39
+
1. If prompted, enter your Azure DevOps PAT, and then select **Enter**.
40
40
41
-
1. Enter a project name such as *toy-website-test*, then select **Enter**.
41
+
1. Enter a project name, such as **toy-website-test**, and then select **Enter**.
42
42
43
43
1. After your project is created, go to your Azure DevOps organization in your browser (at `https://dev.azure.com/<your-organization-name>/`) and select the project.
44
44
1. In Azure DevOps, [Create a self-hosted agent](/azure/devops/pipelines/agents/windows-agent) in the Default pool.
@@ -51,7 +51,7 @@ If you haven't already, create a fork of the **mslearn-test-bicep-code-using-git
51
51
52
52
1. Select **Fork** at the top-right of the screen.
53
53
54
-
1. Choose your GitHub account as the **Owner**, then select **Create fork**.
54
+
1. Choose your GitHub account as the **Owner**, and then select **Create fork**.
Copy file name to clipboardExpand all lines: learn-pr/azure/test-bicep-code-using-azure-pipelines/includes/5-exercise-add-lint-validate-stages-pipeline.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
@@ -112,7 +112,7 @@ Now that you've identified the problem, you can fix it in your Bicep file.
112
112
113
113
1. In Visual Studio Code, open the _main.bicep_ file in the _deploy_ folder.
114
114
115
-
1. Notice that the Bicep linter has also detected that the `storageAccountNameParam` parameter isn't used. Visual Studio Code indicates the unused parameter with a wavy line. Normally, the line would be yellow to indicate a warning. But because you customized the _bicepconfig.json_ file, the linter treats the code as an error and displays the line in red. Here's the line:
115
+
1. Notice that the Bicep linter has also detected that the `storageAccountNameParam` parameter isn't used. Visual Studio Code indicates the unused parameter with a wavy line. Normally, the line would be yellow to indicate a warning. But because you customized the _bicepconfig.json_ file, the linter treats the code as an error and displays the line in red. Here's the line of code:
Copy file name to clipboardExpand all lines: learn-pr/azure/test-bicep-code-using-azure-pipelines/includes/6-preview-approve-deployment.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,10 +61,10 @@ Checks and approvals are evaluated just before a pipeline stage begins. When Azu
61
61
62
62
An approval is one type of check. When you configure an approval check, you assign one or more reviewers who need to approve the continuation of the pipeline.
63
63
64
-
Azure Pipelines also provides other types of checks. For example, you can call an API to run custom logic, control the business hours during which a stage can run, and even query Azure Monitor to ensure that a deployment succeeded. Only approval checks are discussed in this module, but links are provided to more information about checks in the summary.
64
+
Azure Pipelines also provides other types of checks. For example, you can call an API to run custom logic, control the business hours during which a stage can run, and even query Azure Monitor to ensure that a deployment succeeded. Only approval checks are discussed in this module, but the module summary includes links to more information about checks.
65
65
66
66
> [!NOTE]
67
-
> Agent pools and service connections can also have checks configured on them. You can also use a special step called a manual approval task. However, this module focuses on environments and the checks associated with them.
67
+
> Agent pools and service connections can also have checks configured on them. You can also use a special step called a *manual approval task*. However, this module focuses on environments and the checks associated with them.
68
68
69
69
After your pipeline begins and reaches a stage that requires an approval check, the pipeline run pauses. All reviewers who have been designated as approvers are sent a message in Azure DevOps and by email.
Copy file name to clipboardExpand all lines: learn-pr/azure/test-bicep-code-using-azure-pipelines/includes/7-exercise-add-preview-stage-pipeline.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
@@ -23,7 +23,7 @@ First, you'll add a new stage to your pipeline that runs the what-if operation.
23
23
24
24
## Add an environment
25
25
26
-
1. In your browser, go to **Pipelines** > **Environments**.
26
+
1. In Azure DevOps, go to **Pipelines** > **Environments**.
27
27
28
28
:::image type="content" source="../media/7-environments.png" alt-text="Screenshot of the Azure DevOps interface that shows the Environments item on the Pipelines menu.":::
29
29
@@ -33,7 +33,7 @@ First, you'll add a new stage to your pipeline that runs the what-if operation.
33
33
34
34
1. Enter **Website** as the environment name.
35
35
36
-
Leave the description blank. For **Resource**, select **None**.
36
+
Leave the description blank. In the **Resource** section, select **None**.
37
37
38
38
> [!NOTE]
39
39
> In Azure Pipelines, environments are used to enable deployment features. Some of these features apply only when you're deploying to Kubernetes or to virtual machines. In this module, you won't use these features and you can ignore them.
@@ -52,7 +52,7 @@ First, you'll add a new stage to your pipeline that runs the what-if operation.
52
52
53
53
:::image type="content" source="../media/7-add-check-approval.png" alt-text="Screenshot of the Azure DevOps interface that shows the page for adding a check. The Approvals item is highlighted.":::
54
54
55
-
1. In the **Approvers** box, type your own name and select yourself.
55
+
1. In the **Approvers** box, enter your own name and select yourself.
56
56
57
57
1. Expand the **Advanced** section by selecting the down arrow.
0 commit comments