Introduction
When you are managing Azure DevOps in a large enterprise organization, and you are still using only one Azure DevOps organization account, you are probably hitting some limits or have potential performance issues. Microsoft's recommendation is to have around 300 projects in a single Azure DevOps organization account. I have seen Azure DevOps organizations with more than 600 projects that still work.
The solution is to set up a multi-organization structure. Move all the inactive projects to an archive or boneyard Azure DevOps organization account and add an extra Azure DevOps organization account per department.
Next, you need some insights and automation on which projects have no activity anymore. The Azure DevOps Dashboard gives you the basic insights and an API to automate tasks like emailing the owners of inactive projects.
Azure DevOps Dashboard
This dashboard solution generates a simple overview of all the Azure DevOps projects in your organization and calculates the last known activity in days on commits, work items, and the project itself. You can connect this dashboard (using the included endpoint) to Microsoft Power Automate or Excel to automate tasks on project level.
Installation
The solution runs on as a single Azure Web App, it uses a background WebJob to collect all the data needed to present in the web dashboard.
Prerequisites
- An Azure account with an active subscription. Create an account for free.
- Install the Azure CLI on Windows to automate the following steps
- An Azure DevOps personal access token (PAT). See here how to get a personal access token.
- Download the Azure DevOps Dashboard Release.zip package.
Create an Azure Web App
In the next steps, you will create a resource group, an app service plan (the webserver), and the Web App (the solution itself). We also add two application settings to store the Azure DevOps personal access token.
- Login into your Azure subscription
az login
- (Optional) Select the subscription where you like to deploy the dashboard.
az account set --subscription "<your subscription>"
- Create a resource group, change the name
rg-azdevops
az group create -l westeurope -n rg-azdevops
- Create an app service plan and webapp, change the names
plan-azdevops
andazdevops
az appservice plan create -g rg-azdevops -n plan-azdevops -l westeurope
az webapp create -g rg-azdevops -p plan-azdevops -n azdevops -r "DOTNET|6.0"
- Add your Azure DevOps URL and personal access token (PAT)
az webapp config appsettings set -g rg-azdevops -n azdevops --settings azDevOpsPat=<your token>
az webapp config appsettings set -g rg-azdevops -n azdevops --settings azDevOpsUri=https://dev.azure.com/<yourorgname>
- Set the
always-on
future we need for the WebJob
az webapp config set -g rg-azdevops -n azdevops --always-on true
Deploy the Azure DevOps Dashboard
Did you download the Azure DevOps Dashboard Release.zip package? After the installation we also run the WebJob for the first time, this can take a while depending on how many projects you have in your Azure DevOps organization account.
Authentication In the release package authentication is disabled! Please register your application first in your Azure Active Directory by following the steps described here. You only need to update the appsettings.json inside the release package.
az webapp deployment source config-zip -g rg-azdevops -n azdevops --src Release.zip
az webapp webjob triggered run -n azdevops -g rg-azdevops --webjob-name Webjob
Architecture
You can also run the WebJob locally, set the following two environment variable first azDevOpsUri
and azDevOpsPat
that corresponds with your Azure DevOps organization account:
SET azDevOpsPat=tjqp44k54nqfmppaqd7di27kpvh...........
SET azDevOpsUri=https://dev.azure.com/yourorgname.....
Using the API
To automate tasks, you can use the API to connect to Excel, Microsoft Power Automate, or whatever you need. The /api/data
API will return a list of the following project properties:
[
{
"projectId": "guid",
"name": "project name",
"description": "project description",
"url": "https://dev.azure.com/projectname",
"owners": [
{
"displayName": "Contoso Admin name",
"mailAddress": "admin@contoso.com"
}
],
"processTemplate": "Scrum",
"lastProjectUpdateTime": "2021-03-22T11:40:32.09Z",
"lastCommitDate": "2020-04-23T18:00:27Z",
"lastWorkItemDate": "0001-01-01T00:00:00",
"lastKnownActivity": "2021-03-22T11:40:32.09Z",
"projectAge": 83.92575148777316
}
]
Source Code
Alle source code can be found on GitHub.
Top comments (0)