Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,47 +39,54 @@ After you complete this lab, you will be able to:

### Exercise 0: Configure the lab prerequisites

In this exercise, you will set up the prerequisite for the lab, which consists of the pre-configured Parts Unlimited team project based on an Azure DevOps Demo Generator template.
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).

#### Task 1: Configure the team project
#### Task 1: (skip if done) Create and configure the team project

In this task, you will use Azure DevOps Demo Generator to generate a new project based on the **PartsUnlimited** template.
In this task, you will create an **eShopOnWeb** Azure DevOps project to be used by several labs.

1. On your lab computer, start a web browser and navigate to [Azure DevOps Demo Generator](https://azuredevopsdemogenerator.azurewebsites.net). This utility site will automate the process of creating a new Azure DevOps project within your account that is pre-populated with content (work items, repos, etc.) required for the lab.
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**.

> **Note**: For more information on the site, see <https://docs.microsoft.com/azure/devops/demo-gen>.
#### Task 2: (skip if done) Import eShopOnWeb Git Repository

2. Click **Sign in** and sign in using the Microsoft account associated with your Azure DevOps subscription.
3. If required, on the **Azure DevOps Demo Generator** page, click **Accept** to accept the permission requests for accessing your Azure DevOps subscription.
4. On the **Create New Project** page, in the **New Project Name** textbox, type **Configuring Agent Pools and Understanding Pipeline Styles**, in the **Select organization** dropdown list, select your Azure DevOps organization, and then click **Choose template**.
5. On the **Choose a template** page, click the **PartsUnlimited** template, and then click **Select Template**.
6. Click **Create Project**
In this task you will import the eShopOnWeb Git repository that will be used by several labs.

> **Note**: Wait for the process to complete. This should take about 2 minutes. In case the process fails, navigate to your DevOps organization, delete the project, and try again.
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**:

7. On the **Create New Project** page, click **Navigate to project**.
2. The repository is organized the following way:
- **.ado** folder contains Azure DevOps YAML pipelines.
- **.devcontainer** folder container setup to develop using containers (either locally in VS Code or GitHub Codespaces).
- **.azure** folder contains Bicep & ARM infrastructure as code templates used in some lab scenarios.
- **.github** folder contains YAML GitHub workflow definitions.
- **src** folder contains the .NET 6 website used in the lab scenarios.

### Exercise 1: Author YAML-based Azure Pipelines

In this exercise, you will convert a classic Azure Pipeline into a YAML-based one.
In this exercise, you will create an application lifecycle build pipeline, using a YAML-based template.

#### Task 1: Create an Azure DevOps YAML pipeline

In this task, you will create a template-based Azure DevOps YAML pipeline.

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**.
1. From the web browser displaying the Azure DevOps portal with the **EShopOnWeb** project open, in the vertical navigational pane on the left side, click **Pipelines**.
2. On the **Recent** tab of the **Pipelines** pane, click **New pipeline**.
3. On the **Where is your code?** pane, click **Azure Repos Git**.
4. On the **Select a repository** pane, click **PartsUnlimited**.
5. On the **Review your pipeline YAML** pane, review the sample pipeline, click the down-facing caret symbol next to the **Run** button, click **Save**.
4. On the **Select a repository** pane, click **EShopOnWeb**.
5. On the **Configure your pipeline** pane, click **ASP.NET**(Build and test ASP.NET Projects).

> Note: do not select ASP.NET Core (.NET Framework) or the .NET Desktop, although they look identical to the ASP.NET

6. On the **Review your pipeline YAML** pane, review the sample pipeline, click the down-facing caret symbol next to the **Run** button, click **Save**.

> Note: we are just creating the pipeline definition for now, without running it. You will first set up an Azure DevOps agent pool and run the pipeline in a later exercise.

### Exercise 2: Manage Azure DevOps agent pools

In this exercise, you will implement a self-hosted Azure DevOps agent.

#### Task 1: Configure an Azure DevOps self-hosting agent

In this task, you will configure the LOD VM as an Azure DevOps self-hosting agent and use it to run a build pipeline.
In this task, you will configure your lab Virtual Machine as an Azure DevOps self-hosting agent and use it to run a build pipeline.

1. Within the Lab Virtual machine (Lab VM) or your own computer, start a web browser, navigate to [the Azure DevOps portal](https://dev.azure.com) and sign in by using the Microsoft account associated with your Azure DevOps organization.
> **Note**: The Lab Virtual machine should have all necessary prerequisite software installed. If you are installing on your own computer, you will need to install Visual Studio 2022 Community Edition and the .NET SDKs necessary to build the demo project.
Expand All @@ -88,7 +95,7 @@ In this task, you will configure the LOD VM as an Azure DevOps self-hosting agen

| Setting | Value |
| --- | --- |
| Name | **Configuring Agent Pools and Understanding Pipeline Styles lab** |
| Name | **EShopOnWeb** |
| Scope (custom defined) | **Agent Pools** (show more scopes option below if needed)|
| Permissions | **Read and manage** |

Expand All @@ -100,12 +107,12 @@ In this task, you will configure the LOD VM as an Azure DevOps self-hosting agen
6. On the **Personal Access Token** pane of the Azure DevOps portal, click **Azure DevOps** symbol in the upper left corner and then click **Organization settings** label in the lower left corner.
7. To the left side of the **Overview** pane, in the vertical menu, in the **Pipelines** section, click **Agent pools**.
8. On the **Agent pools** pane, in the upper right corner, click **Add pool**.
9. 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**.
10. Back on the **Agent pools** pane, click the entry representing the newly created **az400m05l05a-pool**.
11. On the **Jobs** tab of the **az400m05l05a-pool** pane, click the **New agent** button.
9. On the **Add agent pool** pane, in the **Pool type** dropdown list, select **Self-hosted**, in the **Name** text box, type **az400m03l03a-pool** and then click **Create**.
10. Back on the **Agent pools** pane, click the entry representing the newly created **az400m03l03a-pool**.
11. On the **Jobs** tab of the **az400m03l03a-pool** pane, click the **New agent** button.
12. 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.

> **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.
> **Note**: If you receive an error message at this point indicating that the current system settings prevent you from downloading the file, in the Browser 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 Browser Settings** dialog box, click **Reset** again, click **Close**, and try the download again.

13. Start Windows PowerShell as administrator and in the **Administrator: Windows PowerShell** console run the following lines to create the **C:\\agent** directory and extract the content of the downloaded archive into it.

Expand All @@ -130,8 +137,8 @@ In this task, you will configure the LOD VM as an Azure DevOps self-hosting agen
| Enter server URL | the URL of your Azure DevOps organization, in the format **<https://dev.azure.com/>`<organization_name>`**, where `<organization_name>` represents the name of your Azure DevOps organization |
| Enter authentication type (press enter for PAT) | **Enter** |
| Enter personal access token | The access token you recorded earlier in this task |
| Enter agent pool (press enter for default) | **az400m05l05a-pool** |
| Enter agent name | **az400m05-vm0** |
| Enter agent pool (press enter for default) | **az400m03l03a-pool** |
| Enter agent name | **az400m03-vm0** |
| Enter work folder (press enter for _work) | **Enter** |
| **(Only if shown)** Enter Perform an unzip for tasks for each step. (press enter for N) | **WARNING**: only press **Enter** if the message is shown|
| Enter run agent as service? (Y/N) (press enter for N) | **Y** |
Expand All @@ -142,25 +149,25 @@ In this task, you will configure the LOD VM as an Azure DevOps self-hosting agen
> **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.

16. Switch to the browser window displaying the Azure DevOps portal and close the **Get the agent** pane.
17. Back on the **Agents** tab of the **az400m05l05a-pool** pane, note that the newly configured agent is listed with the **Online** status.
17. Back on the **Agents** tab of the **az400m03l03a-pool** pane, note that the newly configured agent is listed with the **Online** status.
18. In the web browser window displaying the Azure DevOps portal, in the upper left corner, click the **Azure DevOps** label.
19. In the browser window displaying the list of projects, click the tile representing your **Configuring Agent Pools and Understanding Pipeline Styles** project.
20. 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**.
21. On the **Recent** tab of the **Pipelines** pane, select **PartsUnlimited** and, on the **PartsUnlimited** pane, select **Edit**.
22. 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:
20. On the **EShopOnWeb** pane, in the vertical navigational pane on the left side, in the **Pipelines** section, click **Pipelines**.
21. On the **Recent** tab of the **Pipelines** pane, select **EShopOnWeb** and, on the **EShopOnWeb** pane, select **Edit**.
22. On the **EShopOnWeb** 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:

```yaml
name: az400m05l05a-pool
name: az400m03l03a-pool
demands:
- agent.name -equals az400m05-vm0
- agent.name -equals az400m03-vm0
```

> **WARNING**: Be careful with copy/paste, make sure you have same indentation shown above.

23. For `Task: NugetToolInstaller@0`, click on **Settings (link that is displaying above the task in grey color)**, modify **Version of NuGet.exe to install** > **6.6.1** and click on **Add**.
24. 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.
24. On the **EShopOnWeb** 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.
25. In the Azure DevOps portal, in the vertical navigational pane on the left side, in the **Pipelines** section, click **Pipelines**.
26. 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.
26. On the **Recent** tab of the **Pipelines** pane, click the **EShopOnWeb** entry, on the **Runs** tab of the **EShopOnWeb** 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.

## Review

Expand Down