Validate your lab environment

In preparation for the labs, it is crucial to have your environment correctly set up. This page will guide you through the setup process, ensuring all prerequisites are met.

Instructions to create an Azure DevOps Organization (you only have to do this once)

Note: Start at step 3, if you do already have a personal Microsoft Account setup and an active Azure Subscription linked to that account.

  1. Use a private browser session to get a new personal Microsoft Account (MSA) at https://account.microsoft.com.

  2. Using the same browser session, sign up for a free Azure subscription at https://azure.microsoft.com/free.

  3. Open a browser and navigate to Azure portal at https://portal.azure.com, then search at the top of the Azure portal screen for Azure DevOps. In the resulting page, click Azure DevOps organizations.

  4. Next, click on the link labelled My Azure DevOps Organizations or navigate directly to https://aex.dev.azure.com.

  5. On the We need a few more details page, select Continue.

  6. In the drop-down box on the left, choose Default Directory, instead of Microsoft Account.

  7. If prompted (“We need a few more details”), provide your name, e-mail address, and location and click Continue.

  8. Back at https://aex.dev.azure.com with Default Directory selected click the blue button Create new organization.

  9. Accept the Terms of Service by clicking Continue.

  10. If prompted (“Almost done”), leave the name for the Azure DevOps organization at default (it needs to be a globally unique name) and pick a hosting location close to you from the list.

  11. Once the newly created organization opens in Azure DevOps, select Organization settings in the bottom left corner.

  12. At the Organization settings screen select Billing (opening this screen takes a few seconds).

  13. Select Setup billing and on the right-hand side of the screen, select your Azure Subscription and then select Save to link the subscription with the organization.

  14. Once the screen shows the linked Azure Subscription ID at the top, change the number of Paid parallel jobs for MS Hosted CI/CD from 0 to 1. Then select SAVE button at the bottom.

    Note: You may wait a couple of minutes before using the CI/CD capabilities so that the new settings are reflected in the backend. Otherwise, you will still see the message “No hosted parallelism has been purchased or granted”.

  15. In Organization Settings, go to section Pipelines and click Settings.

  16. Toggle the switch to Off for Disable creation of classic build pipelines and Disable creation of classic release pipelines

    Note: The Disable creation of classic release pipelines switch sets to On hides classic release pipeline creation options such as the Release menu in the Pipeline section of DevOps projects.

  17. In Organization Settings, go to section Security and click Policies.

  18. Toggle the switch to On for Allow public projects

    Note: Extensions used in some labs might require a public project to allow using the free version.

Instructions to create and configure the Azure DevOps project (you only have to do this once)

Note: make sure you completed the steps to create your Azure DevOps Organization before continuing with these steps.

To follow all lab instructions, you’ll need set up a new Azure DevOps project, create a repository that’s based on the eShopOnWeb application, and create a service connection to your Azure subscription.

Create the team project

First, you’ll create an eShopOnWeb Azure DevOps project to be used by several labs.

  1. Open your browser and navigate to your Azure DevOps organization.

  2. Select the New Project option and use the following settings:
    • name: eShopOnWeb
    • visibility: Private
    • Advanced: Version Control: Git
    • Advanced: Work Item Process: Scrum
  3. Select Create.

    Create Project

Import eShopOnWeb git repository

Now, you’ll import the eShopOnWeb into your git repository.

  1. Open your browser and navigate to your Azure DevOps organization.

  2. Open the previously created eShopOnWeb project.

  3. Select the Repos > Files, Import a Repository and then select Import.

  4. On the Import a Git Repository window, paste the following URL https://github.com/MicrosoftLearning/eShopOnWeb and select Import:

    Import Repository

  5. 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.
    • .github folder container YAML GitHub workflow definitions.
    • src folder contains the .NET 8 website used on the lab scenarios.
  6. Leave the web browser window open.

  7. Go to Repos > Branches.

  8. Hover on the main branch then click the ellipsis on the right of the column.

  9. Click on Set as default branch.

Create a service connection to access Azure resources

Next, you will create a service connection in Azure DevOps which will allow you to deploy and access resources in your Azure subscription.

  1. Start a web browser, navigate to the Azure DevOps portal with the eShopOnWeb project open and select Project settings in the bottom left corner of the portal.

  2. Select the Service connections under Pipelines, and then select Create service connection button.

    Screenshot of the new service connection creation button.

  3. On the New service connection blade, select Azure Resource Manager and Next (may need to scroll down).

  4. Select Workload Identity federation (automatic) and Next.

    Note: You can also use Workload identity federation (manual) if you prefer to manually configure the service connection. Follow the steps in the Azure DevOps documentation to create the service connection manually.

  5. Fill in the empty fields using the information:
    • Subscription: Select your Azure subscription.
    • Resource group: Select the resource group where you want to deploy resources.
    • Service connection name: Type azure subs. This name will be referenced in YAML pipelines to access your Azure subscription.
  6. Make sure the Grant access permission to all pipelines option is unchecked and select Save.

    Note: The Grant access permission to all pipelines option is not recommended for production environments. It is only used in this lab to simplify the configuration of the pipeline.

    Note: If you see an error message indicating you don’t have the necessary permissions to create a service connection, try again, or configure the service connection manually.

You have now completed the necessary prerequisite steps to continue with the labs.