Configure Branch Policies in Azure Repos

45 minutes
  • 4 Learning Objectives

About this Hands-on Lab

When working in Azure Repos, your company’s policy is to have 2 people review the code before merging into the main branch. You must apply this policy using branch policies in Azure Repos.

**Note:** Please do *not* use the Azure portal credentials provided in this lab. To complete this lab, 2 of your own email addresses are necessary. You can create free accounts at *login.microsoft.com*.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a New Azure DevOps Organization and Project
  • Log in to Azure using your own email account
  • Search for Azure DevOps in Services
  • Create a new organization and private project
Pull Code and Remove Remote Origin
  • Pull the code from here
  • Replace the remote origin
Add a New Member and Branch Policy to the Project
  • From the Azure DevOps project, add a new member to the project
  • Add a branch policy to require 2 reviewers for all pull requests
Create a Branch, Pull Request, and Merge
  • Create a new branch named cool-new-feature
  • Make a change to the Index.cshtml file in the Pages directory
  • Push the changes to Azure Repos
  • From Azure Repos, create a pull request to pull the cool-new-feature branch into main
  • Review the code as each user
  • Successfully merge the code into the main branch

Additional Resources

Note: Please do not use the Azure portal credentials provided in this lab. To complete this lab, 2 of your own email addresses are necessary. You can create free accounts at login.microsoft.com.

Under your account, create a new Azure DevOps organization, followed by a new project. Retrieve the code from the following GitHub repo. Create a new branch and change the Index.cshtml file in the Pages directory. Push the changes to Azure Repos (change the remote origin). Add a second user to your project, and create your branch policies in Azure DevOps to ensure two reviewers review the code before merging into the main branch.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?