🚀 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.
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
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
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.
- First lets click on the
select an element
option in the developers tools - Now hover over the desired project block on the Azure DevOps Organization home page
- Look for the ‘id’ property on the Elements tab of the developer tools
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 .