---
title: "Cross-repository policies in Azure DevOps | Twyzer"
description: "Set branch policies once for all repositories in an Azure DevOps project with cross-repository policies. How to add, configure and remove them."
url: "https://twyzer.nl/blogs/cross-repository-policies-in-azure-devops/"
language: "nl-NL"
---

Blog

# Cross-repository policies in Azure DevOps

Technologie6 juni 2024

![Portret van Dennis van Niel, Engineer bij Twyzer](https://twyzer.nl/media/uploads/2026/07/1Y1A6441-e1786612575478.jpg?width=200 "Dennis van Niel")

Geschreven door

Dennis van Niel - Engineer

In Azure DevOps, effective management of repositories involves implementing robust policies. One powerful feature at your disposal is Cross-Repository Policies. In this guide, I’ll walk you through the process of adding these policies to your DevOps project.

![Illustration of an arm lifting a heavy barbell on an orange background](https://twyzer.nl/media/uploads/2026/08/heavy-lifting-with-one-arm.png?width=1200 "Heavy lifting illustration")

![](https://twyzer.nl/static/gradient.jpg)

To perform the steps described in this article you need to be a Project Administrator.

## How to add a cross-repository policy

Let’s say our standard repository comes with a main and develop branch. Work is done in feature branches, then merged to the develop branch in a Pull Request. When ready to be released, it’s merged to the main branch. All PRs must be reviewed by two people other than the requestor of the Pull Request. The main branch is our default branch.

We want to set a policy on these branches without having to specify them individually for every single repository within our DevOps project.

This is where the cross-repository policy comes in. Cross-repository policies provide a way to enforce uniform policies across branches, and are scoped to a project.

### Navigate to the cross-repository policies

On the main page of the DevOps project click ‘Project Settings’ (1), located in the bottom left corner of the page.

When in the Project Settings click ‘Repositories’ in the index, under **Repos**(2)

From there click the policies link (3) under **All repositories** and you’ll find the ‘Branch policies’ under the ‘Repository Policies’

![Azure DevOps project menu with Project settings marked as step 1](https://twyzer.nl/media/uploads/2026/08/crossrepopolicies_1_project_settings_link-144x300-1.jpg?width=1200 "Open project settings")

_1\. ‘Project settings’ link_ 

![Azure DevOps project settings with Repositories marked as step 2](https://twyzer.nl/media/uploads/2026/08/crossrepopolicies_2_repositories_item-134x300-1.jpg?width=1200 "Open repositories")

_2\. ‘Repositories’ item_ 

![Azure DevOps All Repositories with the Policies tab marked as step 3](https://twyzer.nl/media/uploads/2026/08/crossrepopolicies_3_policies_tab-300x267-1.jpg?width=1200 "Open the Policies tab")

_3\. Link to the ‘Policies’ tab_ 

### Creating the policies

Click the plus-sign in the top-right corner of the branch policies overview to add a new policy (4)

![Azure DevOps Branch Policies with the button to add branch protection across all repositories, step 4](https://twyzer.nl/media/uploads/2026/08/crossrepopolicies_4_branch_policies.png?width=1200 "Add branch protection")

4\. The ‘Branch Policies’ overview

Here you can choose to protect the default branch of each repository or to protect branches matching a pattern.

First enable a policy on the default branch of each repository. Select ‘Protect the default’ branch of each repository (5) and click create.

![Add branch protection with Protect the default branch of each repository selected, step 5](https://twyzer.nl/media/uploads/2026/08/crossrepopolicies_5_branch_protection.png?width=1200 "Protect the default branch")

5\. Available options for Branch protection

Then add the desired option for this policy: requiring a Pull Request to be reviewed by two persons other than the requestor (6) Now the policy is finished. There’s no save button here, changes are saved immediately without having to explicitly save them.

![Cross-repository policy for the default branch requiring a minimum of two reviewers, step 6](https://twyzer.nl/media/uploads/2026/08/crossrepopolicies_6_require_minimum_num_reviewers.png?width=1200 "Minimum number of reviewers")

6\. Setting the ‘Require a minimum number of reviewers’ option

So now we have one policy protecting the default branches. In addition, we would also like to protect the develop branch of each repository.

Return to the policy overview, click the plus-sign, and now select ‘Protect current and future branches matching a specified pattern’ and specify a branch pattern. In our case, the pattern is ‘develop’. (7) As you can see, four matching branches are found across the repositories in my project.

![Add branch protection for the pattern develop, matching four branches in four repositories, step 7](https://twyzer.nl/media/uploads/2026/08/crossrepopolicies_7_branch_protection.png?width=1200 "Protect a branch pattern")

7\. Setting a policy on all ‘develop’ branches

Then click create and set the ‘Minimum number of reviewers’ option for the policy and we are done. All default branches and branches matching the pattern specified, will be subject to the policies we have created within the project settings.

When you look at a policy on a specific branch a label is added next to a policy item, stating that the setting is inherited (8)

![Repository branch policy for develop that is inherited from the cross-repository policy, step 8](https://twyzer.nl/media/uploads/2026/08/crossrepopolicies_8_reference_inherited_policy.png?width=1200 "Inherited branch policy")

8\. The reference to the inherited policy

## How to delete a cross-repository policy

There’s no delete button for this action. A policy can be deleted by turning off all requirements for the cross-repo policy.

### Steps to take

Go to the policy in ‘Project settings’ > ‘Repositories’ > ‘Policies’ and select the policy.

Turn off all ‘Branch policies’, remove items from ‘Build Validation’, ‘Status checks’, and ‘Automatically included reviewers’.

To delete the policy we have created for the develop branch of each repository, turn off the setting ‘Require a minimum number of reviewers’.

Now click the “back-button” next to the title at the top of the page and, presto, the policy for develop has been removed (9) Only the ‘\[default branch\]’ policy remains.

![Azure DevOps Branch Policies with the default branch policy, step 9](https://twyzer.nl/media/uploads/2026/08/crossrepopolicies_9_remove_all_options.png?width=1200 "Remove branch policies")

9\. After removing all options from the ‘develop’ policy, only ‘\[default branch\]’ remains

Removing the default branch policy can be done in the same way.

## Conclusion

This guide provided insights into setting up cross-repository policies in Azure DevOps to ensure uniform branch management across projects. It covered the steps for adding, configuring, and deleting policies, offering an efficient way to maintain consistency in development workflows. Implementing cross-repository policies contributes to a more organized and adaptable approach to project requirements in Azure DevOps.

## Bouw verder op een fundament dat klopt

Je wilt vooruit met data en AI. Maar wel vanuit een omgeving waarop je kunt vertrouwen. Wij helpen je grip te houden, juist wanneer keuzes complex worden. Laten we samen kijken welke stap jouw organisatie nu verder helpt.

[Neem contact met ons op](https://twyzer.nl/contact/)

[Neem contact met ons op](https://twyzer.nl/contact/)

![](https://twyzer.nl/static/pattern.png)![](https://twyzer.nl/static/gradient.jpg)

![Illustratie van servers die verbonden zijn met de cloud](https://twyzer.nl/media/uploads/2026/05/data.png?width=800 "Illustratie data-infrastructuur")

Blogs

## Ook interessant

Gebruik de pijltjestoetsen om door de carousel te navigeren. Gebruik Home en End om naar het begin of einde te gaan.

[![Twee lachende collega's aan een bureau met meerdere schermen](https://twyzer.nl/media/uploads/2026/07/1Y1A6548.jpg?width=800 "Grip op retail begint bij data die je kunt vertrouwen")Actueel28 oktober 2026Grip op retail begint bij data die je kunt vertrouwen](https://twyzer.nl/blogs/betrouwbare-data-retail/)

[![Lachende collega achter een sta-bureau met meerdere schermen vol code](https://twyzer.nl/media/uploads/2026/07/1Y1A6817.jpg?width=800 "Grip op Azure-kosten begint met inzicht en eigenaarschap")Actueel1 oktober 2026Grip op Azure-kosten begint met inzicht en eigenaarschap](https://twyzer.nl/blogs/azure-kosten-beheersen/)

[![Over-de-schouderfoto van een ontwikkelaar die code schrijft op een laptop op een standaard](https://twyzer.nl/media/uploads/2026/07/1Y1A6649.jpg?width=800 "AutoMapper’s Licensing and Security Dilemma")Technologie7 september 2026AutoMapper’s Licensing and Security Dilemma](https://twyzer.nl/blogs/automappers-licensing-and-security-dilemma/)
