How to: Create Dashboard to visualize Environments and Deployments on Azure DevOps

This script and report extract all Environments and respective Deployments to Multi-Stage Pipeline YAML on each Team Project within Azure DevOps

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 Environments and Deployments on each project;
  • $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 = use this REST API to list all projects on the Azure DevOps organization.

3. Environments List = use this REST API to list all Environments on each Team Project

4. Environmentdeployment Records List = use this REST API to list all Deployments on each Environment

5. After extract all Environments and Deployments, this information is stored in a table in Azure SQL.

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

  • Project Name (1) = Filter report using Team Project Name parameter;
  • Environment Name (2) = Filter report using Environment Name parameter;
  • Pipeline Definition Name (3) = Filter report using Pipeline Definition Name parameter;
  • Stage Name (4) = Filter report using Stage Name parameter;
  • Job Name (5) = Filter report using Job Name parameter;
  • Result (6) = Filter report using Result (failed, succeeded) parameter;
  • Environments and Deployments information (7) = list all information about Environments and Deployments (Project Name, Environment Name, Pipeline Definition, Stage Nam,e Job Name, Result, Queue Time, Start Time and, Finish Time).

DevOps Consultant at N3