How to: Create Variable Groups (Libraries) Dashboard on Azure DevOps

This script and report extract all Variables Groups 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.

2. Projects List = use this REST API to list all projects on the Azure DevOps organization.

$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
}

3. Variablegroups Get Variable Groups = use this REST API to list all Variable Groups on each Team Project

$uriVariableGroups = $UriOrganization + "$($project.id)/_apis/distributedtask/variablegroups?api-version=6.0-preview.2"    $VariableGroupsResult = Invoke-RestMethod -Uri $uriVariableGroups -Method get -Headers $AzureDevOpsAuthenicationHeader    Foreach ($vg in $VariableGroupsResult.value)    
{
Write-Host $vg.name
}

4. After extract all Variable Groups, this information is stored in a table in Azure SQL.

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

--

--

Tech Solution Architect Manager na Accenture

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