In this article, we are going to learn how to retrieve the permissions assigned to Azure DevOps – Git Repository using Azure DevOps Rest API
Prerequisites
We are going to use the below tools in order to get the details about Users and the Groups which have access to the Azure DevOps Repository.
- Azure DevOps Organization & Project
- Postman
Introduction
It’s always a daunting job for Azure DevOps administrator to keep track of the access permissions on Azure DevOps resources (ex: Git Repos). In this article, we are going to learn how to get the repo about the Access Permissions for a given Azure DevOps Git repo using Azure DevOps Portal and Azure DevOps Rest API.
Azure DevOps Portal: Let’s look at the easiest option to download the report of all the permissions on a repo (or repos) given to individual users as well as Group. Navigate to Manage Repositories, select a repo and then click on the Security tab which displays all the Groups and Users to whom the permissions have been assigned to as shown below.

In the Security tab shown above, you can see Download detailed report button. Clicking on it will generate a report and Azure DevOps will send you an e-mail as shown below.

You can then use the Download Report link from the email to download the JSON file which contain the detailed data about the Permissions on the selected Repo.
Sometimes, you may want to perform some operations dynamically using some programs. In that case, you may want to invoke Azure DevOps Rest API to download the permission data. Let’s now understand how to invoke the APIs.
Azure DevOps Rest API:
Azure DevOps provides two APIs
- Returns the List of ALL Permission Reports that user has generated
- Returns ALL the permissions for a given Report
In order to consume the API’s you first need to generate the Azure DevOps PAT (Personal Access Token) and once it is ready, open the Postman and let’s make a Get call to the permissionsreport report to view the list of all the Reports that user has generated as shown below.

Once you provide all the details and click on the Send button to get the list of ALL the reports that user has generated as shown below.

Now, grab the id of the report from the above output which will be used in the next call.
Let’s now make another new call to the Permission Download Report by passing the id of the report to the permissionsreport/{id}/download endpoint as shown below.

Once all the details are provided, click on the send button which returns the entire JSON of all the permisions as shown below.

Summary
In this article, we have learnt how to get the list of all the permissions for a given repo(s) of any Azure DevOps project using the Azure DevOps Portal as well as the Azure DevOps Rest API.
Do you like this article? If you want to get more updates about these kind of articles, you can join my Learning Groups