Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit de18b25

Browse files
committed
added alert generation steps + move to EShopOnWeb
1 parent 92a8c06 commit de18b25

1 file changed

Lines changed: 56 additions & 48 deletions

File tree

Instructions/Labs/AZ400_M04_L09_Controlling_Deployments_using_Release_Gates.md

Lines changed: 56 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
lab:
3-
title: 'Controlling Deployments using Release Gates'
3+
title: 'Controlling Deployments using Classic Release Gates'
44
module: 'Module 04: Design and implement a release strategy'
55
---
66

7-
# Controlling Deployments using Release Gates
7+
# Controlling Deployments using Classic Release Gates
88

99
# Student lab manual
1010

@@ -54,21 +54,23 @@ After you complete this lab, you will be able to:
5454

5555
### Exercise 0: Configure the lab prerequisites
5656

57-
In this exercise, you will set up the prerequisites for the lab, which consist of a new Azure DevOps project with a repository based on the [eShopOnWeb](https://github.com/MicrosoftLearning/eShopOnWeb).
57+
> **Note**: If you already created this project during previous labs, this exercise can be skipped.
5858
59-
#### Task 1: (skip if done) Create and configure the team project
59+
In this exercise, you will set up the prerequisites for the lab, which consist of a new Azure DevOps project with a repository based on the [eShopOnWeb](https://github.com/MicrosoftLearning/eShopOnWeb).
6060

61-
In this task, you will create an **eShopOnWeb_ReleaseGates** Azure DevOps project to be used by several labs.
61+
#### Task 1: (skip if already done) Create and configure the team project
6262

63-
1. On your lab computer, in a browser window open your Azure DevOps organization. Click on **New Project**. Give your project the name **eShopOnWeb_ReleaseGates** and leave the other fields with defaults. Click on **Create**.
63+
In this task, you will create an **eShopOnWeb** Azure DevOps project to be used by several labs.
64+
65+
1. On your lab computer, in a browser window open your Azure DevOps organization. Click on **New Project**. Give your project the name **eShopOnWeb** and leave the other fields with defaults. Click on **Create**.
6466

6567
![Create Project](images/create-project.png)
6668

67-
#### Task 2: (skip if done) Import eShopOnWeb Git Repository
69+
#### Task 2: (skip if already done) Import eShopOnWeb Git Repository
6870

6971
In this task you will import the eShopOnWeb Git repository that will be used by several labs.
7072

71-
1. On your lab computer, in a browser window open your Azure DevOps organization and the previously created **eShopOnWeb_ReleaseGates** project. Click on **Repos>Files** , **Import a Repository**. Select **Import**. On the **Import a Git Repository** window, paste the following URL https://github.com/MicrosoftLearning/eShopOnWeb.git and click **Import**:
73+
1. On your lab computer, in a browser window open your Azure DevOps organization and the previously created **eShopOnWeb** project. Click on **Repos>Files** , **Import a Repository**. Select **Import**. On the **Import a Git Repository** window, paste the following URL https://github.com/MicrosoftLearning/eShopOnWeb.git and click **Import**:
7274

7375
![Import Repository](images/import-repo.png)
7476

@@ -79,8 +81,30 @@ In this task you will import the eShopOnWeb Git repository that will be used by
7981
- **.github** folder container YAML GitHub workflow definitions.
8082
- **src** folder contains the .NET 6 website used on the lab scenarios.
8183

84+
#### Task 3: (skip if already done) Configure CI Pipeline as Code with YAML in Azure DevOps
85+
86+
In this task, you will add a YAML build definition to the existing project.
87+
88+
1. Navigate back to the **Pipelines** pane in of the **Pipelines** hub.
89+
1. In the **Create your first Pipeline** window, click **Create pipeline**.
90+
91+
> **Note**: We will use the wizard to create a new YAML Pipeline definition based on our project.
92+
93+
1. On the **Where is your code?** pane, click **Azure Repos Git (YAML)** option.
94+
1. On the **Select a repository** pane, click **eShopOnWeb**.
95+
1. On the **Configure your pipeline** pane, scroll down and select **Existing Azure Pipelines YAML File**.
96+
1. In the **Selecting an existing YAML File** blade, specify the following parameters:
97+
- Branch: **main**
98+
- Path: **.ado/eshoponweb-ci.yml**
99+
1. Click **Continue** to save these settings.
100+
1. From the **Review your Pipeline YAML** screen, click **Run** to start the Build Pipeline process.
101+
1. Wait for the Build Pipeline to complete successfully. Ignore any warnings regarding the source code itself, as they are not relevant for this lab exercise.
102+
103+
> **Note**: Each task from the YAML file is available for review, including any warnings and errors.
82104
83-
#### Task 3: Create two Azure web apps
105+
### Exercise 2: Creating the necessary Azure Resources for the Release Pipeline
106+
107+
#### Task 1: Create two Azure web apps
84108

85109
In this task, you will create two Azure web apps representing the **Canary** and **Production** environments, into which you'll deploy the application via Azure Pipelines.
86110

@@ -119,7 +143,7 @@ In this task, you will create two Azure web apps representing the **Canary** and
119143

120144
1. Wait for the Web App Services Resources provisioning process to complete and close the **Cloud Shell** pane.
121145

122-
#### Task 4: Configure an Application Insights resource
146+
#### Task 2: Configure an Application Insights resource
123147

124148
1. In the Azure portal, use the **Search resources, services, and docs** text box at the top of the page to search for **Application Insights** and, in the list of results, select **Application Insights**.
125149
1. On the **Application Insights** blade, select **+ Create**.
@@ -144,9 +168,9 @@ In this task, you will create two Azure web apps representing the **Canary** and
144168
1. Wait until the change takes effect.
145169

146170
> **Note**: You will create monitor alerts here, which you will use in later part of this lab.
147-
1. From the same **Settings** / **Application Insights** menu option, select **View Application Insight Data**. This redirects you to the Application Insights blade in the Azure Portal.
171+
1. From the same **Settings** / **Application Insights** menu option within the Web App, select **View Application Insights Data**. This redirects you to the Application Insights blade in the Azure Portal.
148172
1. On the Application Insights resource blade, in the **Monitoring** section, click **Alerts** and then click **Create > Alert rule**.
149-
1. On the **Select a signal** blade, in the **Search by signal name** textbox, type **Requests** and select it.
173+
1. On the **Select a signal** blade, in the **Search by signal name** textbox, type **Requests**. From the list of results, select **Failed Requests**.
150174
1. On the **Create an Alert Rule** blade, in the **Condition** section, leave the **Threshold** set to **Static**, validate the other default settings as follows:
151175
- Aggregation Type: Count
152176
- Operator: Greater Than
@@ -165,35 +189,15 @@ In this task, you will create two Azure web apps representing the **Canary** and
165189
166190
1. Confirm the creation of the Alert rule by clicking **Review+Create**, and confirm once more by clicking **Create**. Wait for the alert rule to get created successfully.
167191
168-
### Exercise 1: Configure the build pipeline
169-
170-
In this exercise, you will prepare the release artifact (web deploy zip package) for the .NET 6 eShopOnWeb web application source code.
171-
172-
1. From the [Azure DevOps portal](https://dev.azure.com), navigate to the **eShopOnWeb_ReleaseGates** project you created earlier in this lab.
173-
1. From within the Project, navigate to **Pipelines**.
174-
1. Click **Create Pipelines**.
175-
1. From the **Where is your Code** step, select **Azure Repos(Git)**.
176-
1. In the **Select a repository**, select **eShopOnWeb_ReleaseGates**.
177-
1. From the **Configure your pipeline** step, scroll down in the list and select **Existing Azure Pipelines YAML File**
178-
1. Under the **Select an existing YAML file**, select **main** as Branch, and select **/.ado/eshoponweb-ci.yml** as Path.
179-
1. Click **Continue**.
180-
1. From the YAML pipeline screen, click **Run** to kick off the Build Pipeline.
181-
1. After a few seconds, the status of the Job will switch to **Running**. Ignore any warnings regarding the source code.
182-
1. Click on the **Build** Status line to navigate to the detailed **Running Job** window.
183-
1. Wait for all steps to be completed successfully (green checkmarks). This should take around 2-3min on average.
184-
1. Once the Build Pipeline Job completed successfully, validate the Build Artifacts. From the Job Status page, navigate to the **Summary** tab. Under **Related**, it shows **2 published**. Select this link.
185-
1. From the **Artifacts** page appearing, see **>Bicep** and **>WebSite**.
186-
1. Open **WebSite**. Notice **BlazorAdmin.zip** and **Web.zip**. We will use the **Web.zip** artifact in our upcoming Release Pipeline.
187-
188-
### Exercise 2: Configure the release pipeline
192+
### Exercise 3: Configure the release pipeline
189193
190194
In this exercise, you will configure a release pipeline.
191195
192196
#### Task 1: Set Up Release Tasks
193197
194198
In this task, you will set up the release tasks as part of the Release Pipeline.
195199
196-
1. From the **eShopOnWeb_ReleaseGates** project in the Azure DevOps portal, in the vertical navigational pane, select **Pipelines** and then, within the **Pipelines** section, click **Releases**.
200+
1. From the **eShopOnWeb** project in the Azure DevOps portal, in the vertical navigational pane, select **Pipelines** and then, within the **Pipelines** section, click **Releases**.
197201
1. Click **New Pipeline**.
198202
1. From the **Select a template** window, **choose** **Azure App Service Deployment** (Deploy your application to Azure App Service. Choose from Web App on Windows, Linux, containers, Function Apps, or WebJobs) under the **Featured** list of templates.
199203
1. Click **Apply**.
@@ -202,15 +206,15 @@ In this task, you will set up the release tasks as part of the Release Pipeline.
202206
203207
> **Note**: The pipeline now contains two stages named **Canary** and **Production**.
204208
205-
1. On the **Pipeline** tab, select the **Add an Artifact** rectangle, and select the **eShopOnWeb_ReleaseGates** in the **Source (build pipeline)** field. Click **Add** to confirm the selection of the artifact.
209+
1. On the **Pipeline** tab, select the **Add an Artifact** rectangle, and select the **eShopOnWeb** in the **Source (build pipeline)** field. Click **Add** to confirm the selection of the artifact.
206210
1. From the **Artifact** rectangle, notice the **Continuous Integration Trigger** (lightning bolt) appearing. Click it to open the **Continuous deployment trigger** settings. Click the continuous deployment trigger to toggle the switch to enable it. Leave all other settings at default and close the **Continuous deployment trigger** pane, by clicking the **x** mark in its upper right corner.
207211
1. Within the **Canary Environments** stage, click the **1 job, 2 tasks** label and review the tasks within this stage.
208212
209213
> **Note**: The canary environment has 1 task which, respectively, publishes the artifact package to Azure Web App.
210214
211215
1. On the **All pipelines > New Release Pipeline** pane, ensure that the **Canary** stage is selected. In the **Azure subscription** dropdown list, select your Azure subscription and click **Authorize**. If prompted, authenticate by using the user account with the Owner role in the Azure subscription.
212216
1. Confirm the App Type is set to "Web App on Windows". Next, in the **App Service name** dropdown list, select the name of the **Canary** web app.
213-
1. Select the Task **Deploy Azure App Service**. In the **Package or Folder** field, update the default value of "$(System.DefaultWorkingDirectory)/\*\*/\*.zip" to "$(System.DefaultWorkingDirectory)/\*\*/Web.zip"
217+
1. Select the Task **Deploy Azure App Service**. In the **Package or Folder** field, update the default value of "$(System.DefaultWorkingDirectory)/\*\*/\*.zip" to "$(System.DefaultWorkingDirectory)/\*\*/Web.zip"
214218
215219
> notice an exclamation mark next to the Tasks tab. This is expected, as we need to configure the settings for the Production Stage.
216220
@@ -221,29 +225,29 @@ In this task, you will set up the release tasks as part of the Release Pipeline.
221225
222226
You have now successfully configured the Release Pipeline.
223227
224-
1. In the browser window displaying the **EshopOnWeb_ReleaseGates** project, in the vertical navigational pane, in the **Pipelines** section, click **Pipelines**.
225-
1. On the **Pipelines** pane, click the entry representing **eShopOnWeb_ReleaseGates** build pipeline and then, on the **eShopOnWeb_ReleaseGates** pane, click on **Run Pipeline**.
228+
1. In the browser window displaying the **eShopOnWeb** project, in the vertical navigational pane, in the **Pipelines** section, click **Pipelines**.
229+
1. On the **Pipelines** pane, click the entry representing **eShopOnWeb** build pipeline and then, on the **eShopOnWeb** pane, click on **Run Pipeline**.
226230
1. On the **Run pipeline** pane, accept the default settings and click **Run** to trigger the pipeline. **Wait for the build pipeline to finish**.
227231
228232
> **Note**: After the build succeeds, the release will be triggered automatically and the application will be deployed to both the environments. Validate the release actions, once the build pipeline completed successfully.
229233
230-
1. In the vertical navigational pane, in the **Pipelines** section, click **Releases** and, on the **eShopOnWeb_ReleaseGates** pane, click the entry representing the most recent release.
231-
1. On the **eShopOnWeb_ReleaseGates > Release-1** blade, track the progress of the release and verify that the deployment to both web apps completed successfully.
234+
1. In the vertical navigational pane, in the **Pipelines** section, click **Releases** and, on the **eShopOnWeb** pane, click the entry representing the most recent release.
235+
1. On the **eShopOnWeb > Release-1** blade, track the progress of the release and verify that the deployment to both web apps completed successfully.
232236
1. Switch to the Azure portal interface, navigate to the resource group **az400m04l09-RG**, in the list of resources, click the **Canary** web app, on the web app blade, click **Browse**, and verify that the web page (E-commerce website) loads successfully in a new web browser tab.
233237
1. Switch back to the Azure portal interface, this time navigating to the resource group **az400m04l09-RG**, in the list of resources, click the **Production** web app, on the web app blade, click **Browse**, and verify that the web page loads successfully in a new web browser tab.
234238
1. Close the web browser tab displaying the **EShopOnWeb** web site.
235239
236240
> **Note**: Now you have the application with CI/CD configured. In the next exercise we will set up Quality Gates as part of a more advanced Release pipeline.
237241
238-
### Exercise 3: Configure release gates
242+
### Exercise 4: Configure release gates
239243
240244
In this exercise, you will set up Quality Gates in the release pipeline.
241245
242246
#### Task 1: Configure pre-deployment gates for approvals
243247
244248
In this task, you will configure pre-deployment gates.
245249
246-
1. Switch to the web browser window displaying the Azure DevOps portal, and open the **EshopOnWeb_ReleaseGates** project. In the vertical navigational pane, in the **Pipelines** section, click **Releases** and, on the **New Release Pipeline** pane, click **Edit**.
250+
1. Switch to the web browser window displaying the Azure DevOps portal, and open the **eShopOnWeb** project. In the vertical navigational pane, in the **Pipelines** section, click **Releases** and, on the **New Release Pipeline** pane, click **Edit**.
247251
1. On the **All pipelines > New Release Pipeline** pane, on the left edge of the rectangle representing the **Canary Environment** stage, click the oval shape representing the **Pre-deployment conditions**.
248252
1. On **Pre-deployment conditions** pane, set the **Pre-deployment approvals** slider to **Enabled** and, in the **Approvers** text box, type and select your Azure DevOps account name.
249253
@@ -280,18 +284,22 @@ In this task, you will enable the post-deployment gate for the Canary Environmen
280284
1. Close the **Post-deployment conditions** pane, by clicking the **x** mark in its upper right corner.
281285
1. Back on the **New Release Pipeline** pane, click **Save**, and in the **Save** dialog box, click **OK**.
282286

283-
### Exercise 4: Test release gates
287+
### Exercise 5: Test release gates
284288

285289
In this exercise, you will test the release gates by updating the application, which will trigger a deployment.
286290

287291
#### Task 1: Update and deploy application after adding release gates
288292

289-
In this task, you will track the release process with the release gates enabled.
293+
In this task, you will first generate some alerts for the Canary Web App, followed by tracking the release process with the release gates enabled.
290294

291-
1. From the Azure Portal, in the "Search resources, services and docs" field, enter **Alerts** to open the Alerts Service of Azure Monitor.
292-
1. Notice there should be at least **1 Alert** with **Severity 2 - Warning** showing up in the list. This got trigger when you validated the website in the previous exercise.
295+
1. From the Azure Portal, browse to the **Canary Web App** Resource deployed earlier.
296+
1. From the Overview pane, notice the **URL** field showing the Hyperlink of the web application. Click this link, which redirects you to the EShopOnWeb web application in the browser.
297+
1. To simulate a **Failed Request**, add **/discount** to the URL, which will result in an error message, since that page does not exist. Refresh this page several times to generate multiple events.
298+
1. From the Azure Portal, in the "Search resources, services and docs" field, enter **Application Insights** and select the **Canary-AppInsights** Resource created in the previous exercise. Next, navigate to **Alerts**.
299+
1. There should be at least **1** new alert in the list of results, having a **Severity 2** enter **Alerts** to open the Alerts Service of Azure Monitor.
300+
1. Notice there should be at least **1** Failed_Alert** with **Severity 2 - Warning** showing up in the list. This got trigger when you validated the non-existing website URL address in the previous exercise.
293301

294-
> ** Note:** If no Alert shows up yet, wait another few minutes. Speeding up Alerts is possible by navigating to the Canary-URL again from a browser.
302+
> ** Note:** If no Alert shows up yet, wait another few minutes.
295303

296304
1. Return back to the Azure DevOps Portal, open the **EShopOnWeb-Release Gates** Project. Navigate to **Pipelines**, select **Releases** and select the **New Release Pipeline**.
297305
1. Click the **Create Release** button.
@@ -305,7 +313,7 @@ In this task, you will track the release process with the release gates enabled.
305313

306314
1. Wait another 3 minutes and validate the status of the Release Gates again. As it is now +8 minutes after the initial Release Gates got checked, and it's been more than 8 minutes since the initial Application Insight Alert got triggered with action "Fired", it should result in a successful Release Gate, having allowed the deployment of the Production Release Stage as well.
307315
308-
### Exercise 5: Remove the Azure lab resources
316+
### Exercise 6: Remove the Azure lab resources
309317
310318
In this exercise, you will remove the Azure resources provisioned in this lab to eliminate unexpected charges.
311319

0 commit comments

Comments
 (0)