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

Commit c4119e2

Browse files
authored
Merge pull request #178 from MicrosoftLearning/fix-lab11a
M11-LAB11a: fix VStest issue and update to windows-2019 agent
2 parents aaa3518 + e18067b commit c4119e2

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

Instructions/Labs/AZ400_M11_Configuring_Pipelines_as_Code_with_YAML.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ In this task, you will create an Azure web app and an Azure SQL database by usin
8080
>**Note**: If this is the first time you are starting **Cloud Shell** and you are presented with the **You have no storage mounted** message, select the subscription you are using in this lab, and select **Create storage**.
8181
8282
1. From the **Bash** prompt, in the **Cloud Shell** pane, run the following command to create a resource group (replace the `<region>` placeholder with the name of the Azure region closest to you such as 'eastus').
83-
83+
8484
```bash
85-
RESOURCEGROUPNAME='az400m11l01-RG'
8685
LOCATION='<region>'
86+
```
87+
```bash
88+
RESOURCEGROUPNAME='az400m11l01-RG'
8789
az group create --name $RESOURCEGROUPNAME --location $LOCATION
8890
```
8991

@@ -178,22 +180,29 @@ In this task, you will add a YAML build definition to the existing project.
178180

179181
1. On the **Where is your code?** pane, click **Azure Repos Git (YAML)** option.
180182
1. On the **Select a repository** pane, click **PartsUnlimited**.
181-
2. On the **Configure your pipeline** pane, click **ASP<nolink>.NET** to use this template as the starting point for your pipeline. This will open the **Review your pipeline YAML** pane.
183+
1. On the **Configure your pipeline** pane, click **ASP<nolink>.NET** to use this template as the starting point for your pipeline. This will open the **Review your pipeline YAML** pane.
182184

183185
> **Note**: The pipeline definition will be saved as a file named **azure-pipelines.yml** in the root of the repository. The file will contain the steps required to build and test a typical ASP<nolink>.NET solution. You can also customize the build as needed. In this scenario, you will update the **pool** to enforce the use of a VM running Visual Studio 2017.
184186

185-
3. Make sure `trigger` is **master**.
187+
1. Make sure `trigger` is **master**.
186188

187189
> **Note**: Review in Repos if your repository has **master** or **main** branch, organizations could choose default branch name for new repos: [Change the default branch](https://docs.microsoft.com/en-us/azure/devops/repos/git/change-default-branch?view=azure-devops#choosing-a-name).
188190

189-
4. On the **Review your pipeline YAML** pane, in line **10**, replace `vmImage: 'windows-latest'` with `vmImage: 'vs2017-win2016'`.
190-
5. On the **Review your pipeline YAML** pane, click **Save and run**.
191-
6. On the **Save and run** pane, accept the default settings and click **Save and run**.
192-
7. On the pipeline run pane, in the **Jobs** section, click **Job** and monitor its progress and verify that it completes successfully.
191+
1. On the **Review your pipeline YAML** pane, in line **10**, replace `vmImage: 'windows-latest'` with `vmImage: 'windows-2019'`.
192+
1. Remove the **VSTest@2** task:
193+
```yaml
194+
- task: VSTest@2
195+
inputs:
196+
platform: '$(buildPlatform)'
197+
configuration: '$(buildConfiguration)'
198+
```
199+
1. On the **Review your pipeline YAML** pane, click **Save and run**.
200+
1. On the **Save and run** pane, accept the default settings and click **Save and run**.
201+
1. On the pipeline run pane, in the **Jobs** section, click **Job** and monitor its progress and verify that it completes successfully.
193202

194203
> **Note**: Each task from the YAML file is available for review, including any warnings and errors.
195204

196-
8. Return to the pipeline run pane, switch from the **Summary** tab to the **Tests** tab, and review test statistics.
205+
1. Return to the pipeline run pane, switch from the **Summary** tab to the **Tests** tab, and review test statistics.
197206

198207
#### Task 3: Add continuous delivery to the YAML definition
199208

@@ -285,7 +294,7 @@ In this task, you will add continuous delivery to the YAML-based definition of t
285294
jobs:
286295
- job: Build
287296
pool:
288-
vmImage: 'vs2017-win2016'
297+
vmImage: 'windows-2019'
289298
290299
variables:
291300
solution: '**/*.sln'
@@ -306,11 +315,6 @@ In this task, you will add continuous delivery to the YAML-based definition of t
306315
platform: '$(buildPlatform)'
307316
configuration: '$(buildConfiguration)'
308317
309-
- task: VSTest@2
310-
inputs:
311-
platform: '$(buildPlatform)'
312-
configuration: '$(buildConfiguration)'
313-
314318
- task: PublishBuildArtifacts@1
315319
inputs:
316320
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
@@ -321,7 +325,7 @@ In this task, you will add continuous delivery to the YAML-based definition of t
321325
jobs:
322326
- job: Deploy
323327
pool:
324-
vmImage: 'vs2017-win2016'
328+
vmImage: 'windows-2019'
325329
steps:
326330
- task: DownloadBuildArtifacts@0
327331
inputs:

0 commit comments

Comments
 (0)