I want a release pipeline to create a pull request in the develop branch to pull from the feature branch.
When the task attempts to create the pull request I receive:
TF401027: You need the Git 'PullRequestContribute' permission to perform this action. Details: identity 'Build\\f00fffff-00ff--0fff-ff0f-0000f00ff00f', scope 'repository'.","typeName":"Microsoft.TeamFoundation.Git.Server.GitNeedsPermissionException,
"Allow scripts to access the OAuth token" is ticked.
When I go to the branch security section of the develop branch, I have the option to add accounts with contribute permission, but I can't see any account that matches Build\\f00fffff-00ff--0fff-ff0f-0000f00ff00f
. I've tried adding contribute permissions for the Project Collection Build Service Accounts groups, Project Service Accounts and Build Administrators, but it's still not working.
How do I add the appropriate permissions?
You should go to your repository settings, and you will find a new user named Projectname Build Service(Organizationname). After setting the user’s Contribute to pull requests permission as Allow, your release pipeline can create the pull request without the error message.
And your new pull request will display in the Pull Request -> Active web page, like following.