How to: Deployment Groups and Release Definitions Mapping on Azure DevOps

  1. PowerShell script will receive the following parameters:
  • $PAT = Personal Access token to connect on Azure DevOps;
  • $Organization = Organization URL to list all Deployment Groups and respective Release Definitions that usage them;
  • $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:
$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($PAT)")) }$UriOrganization = "https://dev.azure.com/$($Organization)/" $uriProject = $UriOrganization + "_apis/projects?`$top=500"$ProjectsResult = Invoke-RestMethod -Uri $uriProject -Method get -Headers $AzureDevOpsAuthenicationHeaderForeach ($project in $ProjectsResult.value)
{
Write-Host $project.name
}
$uriReleaseDefinition = $UriOrgRelease + "$($teamproject.name)/_apis/release/definitions"    $ReleaseDefinitionsResult = Invoke-RestMethod -Uri $uriReleaseDefinition -Method Get -Headers $AzureDevOpsAuthenicationHeader     foreach  ($releasedefinition in $ReleaseDefinitionsResult.value)    {
Write-Host $releasedefinition.name
}
$uriDeploymentGroup = $UriOrganization + "$($teamproject.name)/_apis/distributedtask/deploymentgroups/$($deployphases.deploymentInput.queueId)"  $DeploymentGroupResult = Invoke-RestMethod -Uri $uriDeploymentGroup -Method Get -Headers $AzureDevOpsAuthenicationHeaderWrite-Host $DeploymentGroupResult.name
  • Team Project (1) = Filter report using Team Project field;
  • Release Definitions Name (2) = Filter report using Release Definition Name field;
  • Deployment Group Name (3) = Filter report using Deployment Group Name field;
  • Information (4) = List all information about Projects, Release Definitions, and Stage Names (on rows), and respective Deployment Group Name (on columns). If the Release Definition uses the respective Deployment Group, the same will be marked (green ticks on a grid). If you mouse over on the respective cell, will be show information about Phase Name and Machine Name from Deployment Group.

--

--

--

Tech Solution Architect Manager na Accenture

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

YouTube Video | HTML Crash Course — 1

ELI5: ActiveRecord

Announcing the Solana Foundation x Serum DeFi Hackathon

Simplified step by step ways to install Python and Vscode on your Computer.

Video Chat app using Gatsby and twilio-1

Basic definitions on Go language / REST API / PostgreSQL

Django Shortcuts: Social Auth

I’m sick of lists of habits that are unrealistic for the majority of people.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vinicius Moura

Vinicius Moura

Tech Solution Architect Manager na Accenture

More from Medium

How to: Team Projects, Fields, and Picklists Mapping on Azure DevOps

Getting Started With Azure Bicep

How to extend an Azure DevOps YAML Pipeline Template

Using user-assigned managed identities in Azure Automation Runbooks