Determine Usage of Azure Hosted Agents

84 Views Asked by At

I am looking for a way to find out how much my Hosted Agents have been used (in hours) for a week/month. Do you know a way to do so? Is there an REST-API Endpoint I could use or can you recommend an extension which would be helpfull?

Thank you

3

There are 3 best solutions below

1
On

I think the endpoint is:

https://dev.azure.com/{organization}/_apis/distributedtask/pools/{poolId}?api-version=7.1-preview.1

Or

https://dev.azure.com/{organization}/{project}/_apis/distributedtask/pools/{poolId}?api-version=6.0

HTTP verb: GET

Example usage in BASh:

organization="your-organization"
project="your-project"
agentPoolId="your-agent-pool-id"

curl -u username:password "https://dev.azure.com/$organization/$project/_apis/distributedtask/pools/$agentPoolId?api-version=6.0"
0
On

you can use the Azure DevOps REST API. Have a look at this - https://learn.microsoft.com/en-us/rest/api/azure/devops/distributedtask/pools/get?view=azure-devops-rest-7.1

This API allows you to get a list of build and release runs, including their duration. There are also Azure DevOps extensions available in the Visual Studio Marketplace that might provide more user-friendly reporting or integrate with other analytics tools.

0
On

You can use this extension Build usage. It can show how many build minutes are being used within an account and make them visible for your team by adding Build Usage tiles to your dashboard.

My test screenshoot:

enter image description here

enter image description here

enter image description here