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

Commit 44bbff5

Browse files
authored
Merge pull request #194 from MicrosoftLearning/lab5-update
Updated lab 05
2 parents 00325ed + 7467469 commit 44bbff5

1 file changed

Lines changed: 3 additions & 106 deletions

File tree

Instructions/Labs/AZ400_M05_Configuring_Agent_Pools_and_Understanding_Pipeline_Styles.md

Lines changed: 3 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -85,106 +85,6 @@ In this task, you will create a template-based Azure DevOps YAML pipeline.
8585
1. On the **Configure your pipeline** pane, click **Starter pipeline**.
8686
1. On the **Review your pipeline YAML** pane, review the sample pipeline, click the down-facing caret symbol next to the **Save and run** button, click **Save** and, on the **Save** pane, click **Save**.
8787

88-
> **Note**: This will result in creation of the **azure-pipelines.yml** file in the root directory of the repository hosting the project code.
89-
90-
> **Note**: You will replace the content of the sample YAML pipeline with the code of pipeline generated by the classic editor and modify it to account for differences between the classic and YAML pipelines.
91-
92-
#### Task 2: Convert a classic pipeline into a YAML pipeline
93-
94-
In this task, you will convert a classic pipeline into a YAML pipeline
95-
96-
1. From the web browser displaying the Azure DevOps portal with the **Configuring Agent Pools and Understanding Pipeline Styles** project open, in the vertical navigational pane on the left side, click **Pipelines**.
97-
1. On the **Recent** tab of the **Pipelines** pane, hover with the mouse pointer over the right edge of the entry containing the **PartsUnlimitedE2E** entry to reveal the vertical ellipsis symbol designating the **More** menu, click the ellipsis symbol, and, in the dropdown menu, click **Edit**. This will display the build pipeline that is part of the project you generated at the beginning of the lab.
98-
1. On the **Tasks** tab of the **PartsUnlimitedE2E** edit pane, click **Triggers**, on the right side of the **PartsUnlimited** pane, uncheck the **Enable continuous integration** checkbox, click the down-facing caret next to the **Save & queue** button, in the dropdown menu, click **Save**, and in the **Save build pipeline** click **Save**.
99-
100-
> **Note**: This will prevent from unintended execution of automatic build due to changes to the repository during this lab.
101-
102-
> **Note**: Alternatively, you could simply delete the existing pipeline once you copy its content into the new one.
103-
104-
1. In the Azure DevOps portal, in the vertical navigational pane on the left side, in the **Pipelines** section, click **Pipelines**.
105-
1. On the **Recent** tab of the **Pipelines** pane, click the **PartsUnlimitedE2E** entry.
106-
1. On the **Runs** tab of the **PartsUnlimitedE2E** pane, in the upper right corner, click the vertical ellipsis (three vertical dots) symbol and, in the dropdown menu, click **Export to YAML**. This will automatically download the **PartsUnlimitedE2E.yml** file to your local **Downloads** folder.
107-
108-
> **Note**: The **Export to YAML** feature replaces an older **View YAML** option available from the pipeline editor pane within the Azure DevOps portal, which was limited to viewing YAML content one job at a time. The new functionality leverages existing classic and YAML pipeline infrastructure, including YAML parsing library, which results in more accurate translation between the two. It supports the following pipeline components:
109-
> - Single and multiple jobs
110-
> - Checkout options
111-
> - Execution plan parallelism
112-
> - Timeout and name metadata
113-
> - Demands
114-
> - Schedules and other triggers
115-
> - Pool selection, including jobs which differ from the default
116-
> - All tasks and all inputs, including optimizing for default inputs
117-
> - Job and step conditions
118-
> - Task group unrolling
119-
120-
> **Note**: The only components not covered by the new functionality are variables and timezone translation. Variables defined in YAML override variables set in the user interface of the Azure DevOps portal. If the **Export to YAML** feature detects presence of Classic pipeline variables, they will be explicitly included in the comments within the newly generated YAML pipeline definition. Similarly, since cron schedules in YAML are expressed in UTC, while classic schedules rely on the organization’s timezone, their presence is also included in the comments.
121-
122-
> **Note**: For more information regarding this functionality, refer to [Replacing "View YAML"](https://devblogs.microsoft.com/devops/replacing-view-yaml/)
123-
124-
1. On the lab computer, start Visual Studio Code and use it to open the file **PartsUnlimitedE2E.yml**. The file should have the following content:
125-
126-
```yaml
127-
name: $(date:yyyyMMdd)$(rev:.r)
128-
jobs:
129-
- job: Phase_1
130-
displayName: Phase 1
131-
cancelTimeoutInMinutes: 1
132-
pool:
133-
vmImage: windows-2019
134-
steps:
135-
- checkout: self
136-
- task: NuGetInstaller@0
137-
name: NuGetInstaller_1
138-
displayName: NuGet restore
139-
inputs:
140-
solution: '**\*.sln'
141-
- task: VSBuild@1
142-
name: VSBuild_2
143-
displayName: Build solution
144-
inputs:
145-
vsVersion: '17.0'
146-
msbuildArgs: /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.stagingDirectory)" /p:IncludeServerNameInBuildInfo=True /p:GenerateBuildInfoConfigFile=true /p:BuildSymbolStorePath="$(SymbolPath)" /p:ReferencePath="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\Pex"
147-
platform: $(BuildPlatform)
148-
configuration: $(BuildConfiguration)
149-
- task: VSTest@1
150-
name: VSTest_3
151-
displayName: Test Assemblies
152-
inputs:
153-
testAssembly: '**\$(BuildConfiguration)\*test*.dll;-:**\obj\**'
154-
codeCoverageEnabled: true
155-
vsTestVersion: latest
156-
platform: $(BuildPlatform)
157-
configuration: $(BuildConfiguration)
158-
- task: CopyFiles@2
159-
name: CopyFiles1
160-
displayName: Copy Files
161-
inputs:
162-
SourceFolder: $(build.sourcesdirectory)
163-
Contents: '**/*.json'
164-
TargetFolder: $(build.artifactstagingdirectory)
165-
- task: PublishBuildArtifacts@1
166-
name: PublishBuildArtifacts_5
167-
displayName: Publish Artifact
168-
inputs:
169-
PathtoPublish: $(build.artifactstagingdirectory)
170-
TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)'
171-
...
172-
```
173-
174-
1. In the Visual Studio Code window, in the top-level menu, click **Selection** and, in the dropdown menu, click **Select All**.
175-
1. In the Visual Studio Code window, in the top-level menu, click **Edit** and, in the dropdown menu, click **Copy**.
176-
1. Switch to the browser window displaying the Azure DevOps portal and, in the vertical navigational pane on the left side, in the **Pipelines** section, click **Pipelines**.
177-
1. On the **Recent** tab of the **Pipelines** pane, select **PartsUnlimited** and, on the **PartsUnlimited** pane, select **Edit**.
178-
1. On the **PartsUnlimited** edit pane, select the existing YAML content of the pipeline, replace it with the content of Clipboard.
179-
1. Add a CI Trigger, paste these lines on the top of the file:
180-
```yaml
181-
trigger:
182-
- master
183-
```
184-
1. On the **PartsUnlimited** edit pane, in the upper-right corner, click **Save**, and, on the **Save** pane, click **Save**. This will automatically trigger the build based on this pipeline.
185-
1. In the Azure DevOps portal, in the vertical navigational pane on the left side, in the **Pipelines** section, click **Pipelines**.
186-
1. On the **Recent** tab of the **Pipelines** pane, click the **PartsUnlimited** entry, on the **Runs** tab of the **PartsUnlimited** pane, select the most recent run, on the **Summary** pane of the run, scroll down to the bottom, in the **Jobs** section, click **Phase 1** and monitor the job until its successful completion.
187-
18888
### Exercise 2: Manage Azure DevOps agent pools
18989

19090
In this exercise, you will implement self-hosted Azure DevOps agent.
@@ -213,8 +113,7 @@ In this task, you will configure the LOD VM as an Azure DevOps self-hosting agen
213113
1. On the **Agent pools** pane, in the upper right corner, click **Add pool**.
214114
1. On the **Add agent pool** pane, in the **Pool type** dropdown list, select **Self-hosted**, in the **Name** text box, type **az400m05l05a-pool** and then click **Create**.
215115
1. Back on the **Agent pools** pane, click the entry representing the newly created **az400m05l05a-pool**.
216-
1. On the **Jobs** tab of the **az400m05l05a-pool** pane, click the **Agents** header.
217-
1. On the **Agents** tab of the **az400m05l05a-pool** pane, click the **New agent** button.
116+
1. On the **Jobs** tab of the **az400m05l05a-pool** pane, click the **New agent** button.
218117
1. On the **Get the agent** pane, ensure that the **Windows** and **x64** tabs are selected, and click **Download** to download the zip archive containing the agent binaries to download it into the local **Downloads** folder within your user profile.
219118

220119
> **Note**: If you receive an error message at this point indicating that the current system settings prevent you from downloading the file, in the Internet Explorer window, in the upper right corner, click the gearwheel symbol designating the **Settings** menu header, in the dropdown menu, select **Internet Options**, in the **Internet Options** dialog box, click **Advanced**, on the **Advanced** tab, click **Reset**, in the **Reset Internet Explorer Settings** dialog box, click **Reset** again, click **Close**, and try the download again.
@@ -252,22 +151,20 @@ In this task, you will configure the LOD VM as an Azure DevOps self-hosting agen
252151
253152
> **Note**: You can run self-hosted agent as either a service or an interactive process. You might want to start with the interactive mode, since this simplifies verifying agent functionality. For production use, you should consider either running the agent as a service or as an interactive process with auto-logon enabled, since both persist their running state and ensure that the agent starts automatically if the operating system is restarted.
254153
255-
> **Note**: Verify that the agent is reporting the **Listening for Jobs** status.
256-
257154
1. Switch to the browser window displaying the Azure DevOps portal and close the **Get the agent** pane.
258155
1. Back on the **Agents** tab of the **az400m05l05a-pool** pane, note that the newly configured agent is listed with the **Online** status.
259156
1. In the web browser window displaying the Azure DevOps portal, in the upper left corner, click the **Azure DevOps** label.
260157
1. In the browser window displaying the list of projects, click the tile representing your **Configuring Agent Pools and Understanding Pipeline Styles** project.
261158
1. On the **Configuring Agent Pools and Understanding Pipeline Styles** pane, in the vertical navigational pane on the left side, in the **Pipelines** section, click **Pipelines**.
262159
1. On the **Recent** tab of the **Pipelines** pane, select **PartsUnlimited** and, on the **PartsUnlimited** pane, select **Edit**.
263-
1. On the **PartsUnlimited** edit pane, in the existing YAML-based pipeline, replace line **7** `vmImage: windows-2019` designating the target agent pool the following content, designating the newly created self-hosted agent pool:
160+
1. On the **PartsUnlimited** edit pane, in the existing YAML-based pipeline, replace line `vmImage: windows-2019` designating the target agent pool the following content, designating the newly created self-hosted agent pool:
264161
265162
```yaml
266163
name: az400m05l05a-pool
267164
demands:
268165
- agent.name -equals az400m05-vm0
269166
```
270-
1. For `Task: NugetInstaller@0`, click on **Settings (link that is displaying above the task in grey colour)**, modify **Advanced > NuGet Version > 4.0.0** and click on **Add**.
167+
1. For `Task: NugetInstaller@0`, click on **Settings (link that is displaying above the task in grey colour)**, modify **Version of NuGet.exe to install** > **4.0.0** and click on **Add**.
271168
1. On the **PartsUnlimited** edit pane, in the upper right corner of the pane, click **Save** and, on the **Save** pane, click **Save** again. This will automatically trigger the build based on this pipeline.
272169
1. In the Azure DevOps portal, in the vertical navigational pane on the left side, in the **Pipelines** section, click **Pipelines**.
273170
1. On the **Recent** tab of the **Pipelines** pane, click the **PartsUnlimited** entry, on the **Runs** tab of the **PartsUnlimited** pane, select the most recent run, on the **Summary** pane of the run, scroll down to the bottom, in the **Jobs** section, click **Phase 1** and monitor the job until its successful completion.

0 commit comments

Comments
 (0)