Forum Discussion
bbliang
Feb 16, 2023Copper Contributor
How to grant Service Principle access right to Azure Repos
In Azure Pipelines, we need to get source code of another organization's Azure Repos. Currently we use personal access token, but it links to a user who might leave the organization. Can we use a ser...
Kidd_Ip
Apr 05, 2023MVP
Would like to share a similar post for reference:
- bbliangApr 06, 2023Copper ContributorThanks.
I encountered the same authentication error when creating Azure Repos Connection with the Service Principle's APP ID and secret.
So it is not workable to use Service Principle to access another organization's Azure Repository.- RobinaApr 07, 2023Iron ContributorIt is possible to use a service principal to access another organization's Azure Repositories, but it requires some additional steps to grant the necessary permissions.
First, you will need to ensure that the service principal has been granted access to the Azure DevOps organization where the repositories are located. This can be done by adding the service principal as a member of the Azure DevOps organization, and granting it the appropriate permissions.
Next, you will need to grant the service principal access to the specific Azure Repositories that you want to access. This can be done by going to the Azure Repositories security settings and adding the service principal as a contributor or a reader, depending on the level of access you require.
Once the service principal has been granted access to the Azure DevOps organization and the Azure Repositories, you can use its App ID and secret to authenticate your connection.- bbliangApr 13, 2023Copper Contributor
Have added the service principle to the organization
Have granted the service principle "Project Reader" Role for the project
Have granted read access right to all repositories of the project.
But still got the error message when verify the service connection