i have a entra group X, i want to add them in repository and set the permission as admin access through API. and it should be visible in UI here com-project → Project Settings → Repositories → sample-project.
i am expecting the API to add them in repo and visible in UI
1 Answer 1
Adding Entra Group as Repository Administrator via API
API Endpoint:
POST https://dev.azure.com/{organization}/_apis/accesscontrolentries/2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87?api-version=7.1
Request Body:
{
"token": "repoV2/{projectId}/{repositoryId}",
"merge": true,
"accessControlEntries": [
{
"descriptor": "aadgp.{entraGroupObjectId}",
"allow": 8188,
"deny": 0
}
]
}
Key Details:
Security Namespace ID:
2e9eb7ed-3c0a-47d4-87c1-0ffdd275fd87(Git repositories)Token format:
repoV2/{projectId}/{repositoryId}Descriptor format:
aadgp.{entraGroupObjectId}Admin permissions value:
8188(includes all repository admin rights)
Requirements:
PAT token with "Project and Team (read, write, & manage)" permissions
Entra group Object ID from Azure AD
Project and Repository GUIDs
Verification: After the API call, the group will appear in: Project Settings → Repositories → {repository-name} → Security tab with Administrator permissions.
The changes typically reflect in the UI within a few minutes.