Giving a script Git access to a single Azure Repo

那年仲夏 提交于 2021-01-29 21:25:55

问题


I want to poll an Azure Repo for changes with Git. A personal access token from my account would give it too much permissions.

Should I create a new user in Azure AD, add it to Azure Repo with read only and use it in the script? Or is there a better way than creating real users.


回答1:


If you want to allow your git script to only access one specific Azure Repo. I'm afraid you will need to create a new user as a service account.

After the service account is created and added to your azure devops organization. You can set its access permission to only one repo in the project settings page. See below:

  • First deny its access to all the repositories.

Project settings-->Click Git repositories-->Search for the service account-->Deny Read permission

  • Then allow the Read permission to that one specific repository.

Project settings-->Select the repository you want allow the read permission-->Search for the service account-->Allow Read permission

The PAT generated from this service account will only have the access to that specific repo.



来源:https://stackoverflow.com/questions/61799938/giving-a-script-git-access-to-a-single-azure-repo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!