Consider the following branch policy set at the project level:
How to delete a releases/xxxxx
branch that was created by accident?
When trying to do it using the portal an error message is displayed (as expected):
I'd like to avoid disabling the branch policy, if possible.
The error message mentions some sort of exemption, but I couldn't find any documentation about it (it would be great to have a link to the documentation when the message is displayed).
You can adjust the security for the specific branch you would like to delete (rather than at the "folder" level). In the 3-dots menu, select "Branch Security", and then assign yourself "Allow" for both of these permissions:
Then you will be able to delete the branch.
Side Note: This answer works when you only need to delete a small number of branches (like in your case). But if you need to delete many branches that have policies set at the folder level, you'll probably want to temporarily disable the policy, delete the branches, and then put the policy back. This is because (unfortunately) it's not possible to set security at the folder level, like you can with policies. Update: It looks like you can set permissions to folders in AzDO Services (Cloud), but not in AzDO Server 2022. So in Azure Repos, if you need to delete many branches, you could try to temporarily grant yourself the proper permissions at the folder level. Be cautious here though- this may only work if you are using inherited permissions, and if you aren't, AFAIK you can't temporarily turn that on and then off again, and easily get back to where you were before.