gitazure-devopsazure-pipelinesazure-pipelines-build-task

Azure pipeline does't allow to git push throwing 'GenericContribute' permission is needed


I'm trying to push some changes done during Azure pipeline using cmd component as follows,

steps:
- script: |
   git config user.email you@you.com
   git config user.name "your name"
   git diff
   git  add .
   git commit -m "version update [skip ci]"
   git push origin HEAD:master

But it fails showing following error.

remote: 0000000000aaTF41027: You need the Git 'GenericContribute' permission to perform this action. Details: identity 'Build\sdfdfjjkk', scope 'repository'

I already set the necessary permission as follows:

enter image description here

And the Allow scripts to access the OAuth token is also enabled as mentioned here

What other permissions do I need to give this to work?


Solution

  • You need to grant the permissions to Project Collection Build Service (account name):

    enter image description here