How to: Release Definitions and Tasks Mapping on Azure DevOps

This script and report extract all Release Tasks on any Release Definitions to map where they are being used within the Azure DevOps organization

This report was based on the extension Build Task Explorer. Thanks, Mathias Olausson for inspiring this publication.

An original script is available on my GitHub repository. See below this script:

Let’s go understand each command used.

  1. PowerShell script will receive the following parameters:
  • $PAT = Personal Access token to connect on Azure DevOps;
  • $Organization = Organization URL to list all Team Projects, Release Definitions, and Release Tasks;
  • $Connstr = connection string to Azure SQL Database that stores the report information. To create this report, it’s necessary to create previously a Azure SQL Server and Database and run a script below:

2. Projects List = uses this REST API to list all Team Projects on Azure DevOps organization

3. Definition List = uses this REST API to list all Release Definitions on each Team Project

4. Definition Get = uses this REST API to get details about Release Definition (Environments, Deploy Phases, and Release Tasks)

5. After extract all Team Projects, Release Definitions, and Release Tasks, this information is stored in a table in Azure SQL.

6. After insert information into a table, I connected this database on Power BI:

  • Task Name (1) = Filter report using Task Name field;
  • Team Project Name (2) = Filter report using Team Project Name field;
  • Release Definition Name (3) = filter report using Release Definition Name field;
  • Release Definitions and Tasks Mapping Information (4) = List all information about Release Tasks, Project Name, Definition Name, and Number of usages from a respective task;
  • Number of usages = Looking at the example above, the Azure Key Vault task is being used 2 times in the Release Definition Sprint 100 RMFeatures.

DevOps Consultant at N3