How to: Release Definitions and Tasks 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 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:
$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
}
$uriReleaseDefinitions = $uriReleases + "$($project.id)/_apis/release/definitions?api-version=6.1-preview.4"    $ReleaseDefintionsResult = Invoke-RestMethod -Uri $uriReleaseDefinitions -Method get -Headers $AzureDevOpsAuthenicationHeader    Foreach ($releaseDef in $ReleaseDefintionsResult.value)
{
Write-Host $releaseDef.name
}
$uriReleaseDef = $uriReleases + "$($project.id)/_apis/release/definitions/$($releaseDef.id)?api-version=6.1-preview.4"        $ReleaseDefResult = Invoke-RestMethod -Uri $uriReleaseDef -Method get -Headers $AzureDevOpsAuthenicationHeader        Foreach ($environment in $ReleaseDefResult.environments)
{
Write-Host $environment.name
}
  • 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.

--

--

--

Tech Solution Architect Manager na Accenture

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

Recommended from Medium

Securing your ASP.NET database access with Azure SQL and Azure pipelines

GOING TO BED STATUS:

THORChain —  Network Load

JaSON Dependency Removed

Animation Woes

Mobile App to Avoid Frauds and Bureaucracy in Car Insurance: case study

How to become a software development engineer?

Software Complexity, Estimation, and Einstein

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

Create Azure Purview using Bicep

Create Azure Automation Account (using managed identity) and Runbooks using Azure PowerShell and…

How to extend an Azure DevOps YAML Pipeline Template