Contents

🚀 Quickly Find Your Azure DevOps Project Id 🔍

With this post I want to share a lazy and a hacky way for finding the Azure DevOps Project Id of any project in your Azure DevOps Organization.

The lazy API query

It can feel a bit daunting to start using Azure DevOps API. But what most folks are not aware of is that data retrieval API’s can be queried using your favorite browser. To get the Project Id we can do this with the projects LIST and GET API’s.

Authentication is required
Navigating the API’s is subjected to the same authentication and authorization as regular Azure DevOps browsing. So we can expect a log-in prompt. Also all API’s are security trimmed to the user permissions in question and will only return data the user in question is authorized to access.

Projects LIST

The list API will return all the available Azure DevOps projects including their project Id’s.

Aure DevOps projects list api
https://dev.azure.com/[YOUR_ORGANIZATION_NAME]/_apis/projects?api-version=5.0

Example with demojev Azure DevOps Organization
https://dev.azure.com/demojev/_apis/projects?api-version=5.0
/posts/2024/quickly-find-your-azure-devops-project-id/projects-list-api.png
Projects LIST results

Projects GET

The get api will return information about a single Azure DevOps project, it requires the project name to be included in the uri.

Aure DevOps projects get api
https://dev.azure.com/[YOUR_ORGANIZATION_NAME]/_apis/projects/The%20Cloud%20Explorers?api-version=5.0

Example with demojev Azure DevOps Organization and The Cloud Explorers project
https://dev.azure.com/demojev/_apis/projects/The%20Cloud%20Explorers?api-version=5.0
/posts/2024/quickly-find-your-azure-devops-project-id/projects-get-api.png
Projects GET results

The hacky HTML

It turns out that the project id of every project is embedded into the HTML body of Azure DevOps. So the most ‘dirty’ way of getting the project id is to inspect the HTML of the Azure DevOps Organization home page. We cn do this by following the 3 steps below.

We need to have Azure DevOps Organization home page and the browsers developer tools (F12 is the common shortcut) open.

  1. First lets click on the select an element option in the developers tools
  2. Now hover over the desired project block on the Azure DevOps Organization home page
  3. Look for the ‘id’ property on the Elements tab of the developer tools
/posts/2024/quickly-find-your-azure-devops-project-id/html-hack.png
HTML hack example

Wrapping up

And that’s all folks! I hope you found this post educational. If you are interested in the reference material used to make this post, please visit the following links.

As always, a big thanks for reading this post. If you liked it, don’t be shy and have a look at my other posts .