1

How to get the list of projects, repositories and teams created in Azure DevOps. Also the administrators, contributors and pull request approver's list. I have seen the API mentioned in Azure docs but it provides the info in json format which has a lot of info and is really difficult to pull out the project and repository name. How can I get that data in excel or word document?

2
  • azure devops queries?
    – 4c74356b41
    Apr 26, 2019 at 10:44
  • @Mudit The API is a good way, which results did you get? you can filter json easily. Apr 28, 2019 at 7:13

4 Answers 4

2

Best option looks like Rest APIs which returns json, but I am afraid there is no easy way to export them to excel or word.

For people who are searching what exactly are the Rest API endpoints to fetch them, here are the details;

How to get git repositories?

You can follow following steps to see the count of repositories

  1. Login to Azure DevOps
  2. Open one of following links by modifying your organization and project name

https://dev.azure.com/{ORGANIZATION_NAME}/{PROJECT_NAME}/_apis/git/repositories/ https://dev.azure.com/{ORGANIZATION_NAME}/{PROJECT_ID}/_apis/git/repositories/

  1. Scroll to the end of the json response and you should see the count at the end of the page Sample Api Response

How to get projects?

Follow step 1 and then open the link below

https://dev.azure.com/{ORGANIZATION_NAME}/_apis/projects

How to get teams?

Follow step 1 and then open the link below

https://dev.azure.com/{ORGANIZATION_NAME}/_apis/teams

How to find the project Id?

In Chrome, open the developer tools, open Azure DevOps and navigate to your project then you should see following calls which will give you the project id Call from Chrome Developer Tools

1

list all repos and count the lines assuming you have access to.

# get repo details
$repo_list = az devops project list --query 'value[].name' -o tsv | % { az repos list --project $_ -o tsv} 
# count the output lines
$repo_list = az devops project list --query 'value[].name' -o tsv | % { az repos list --project $_ -o tsv} | wc -l```
note: ran this in powershell with a computer with git bash. the wc command is not a powershell command normally
1
  • instead of wc I used powershell native Measure-Object -line like: az devops project list --query 'value[].name' -o tsv | % { az repos list --project $_ -o tsv} | Measure-Object -line Aug 9, 2023 at 8:57
0

How to get the count of projects, repositories and teams created in Azure DevOps?

I am afraid there is no such out of box method to get that data in excel or word document at this moment. We could not get the list of projects,repositories via queries and export it to the excel or word document.

To achieve this, you can accept the advise of Shayki Abramczyk, using the Rest API.

After get the response in json format, then parse the json file with Powershell or other scripts, like:

PS Script Get All Team Projects Listed as HTML–TFS/VSTS

Besides, when we parse the josn file, we even could export the data to the csv file:

Ticket: How to export data to CSV in PowerShell?

Hope this helps.

0

The best way to retrieve the list of Project and team is using the OData feed. One can use excel or Power bi to retrieve the data. I am attaching how to retrieve the list of team and Project from Azure DevOps. https://learn.microsoft.com/en-us/azure/devops/report/powerbi/access-analytics-power-bi?view=azure-devops

1
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Pierre P.
    Oct 27, 2022 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.