How to: Service Hooks Mapping on Azure DevOps

This script and report list all Service Hooks (in all Team Projects) within the Azure DevOps organization

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

Let’s go understand each command used.

2. Subscription List = uses this REST API to list all Service Hooks (in all Team Projects) within the Azure DevOps organization.

$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($PAT)")) }$UriServiceHooks = "https://dev.azure.com/$($Organization)/_apis/hooks/subscriptions?api-version=6.1-preview.1"$ServiceHooksResult = Invoke-RestMethod -Uri $UriServiceHooks -Method get -Headers $AzureDevOpsAuthenicationHeader Foreach ($serviceHook in $ServiceHooksResult.value)
{
Write-Host $serviceHook.eventDescription
}

3. Projects Get = uses this REST API to get specific Team Project within the Azure DevOps organization.

$UriGetProject = "https://dev.azure.com/$($Organization)/_apis/projects/$($serviceHook.publisherInputs.projectId)?api-version=6.1-preview.4"   $GetProjectResult = Invoke-RestMethod -Uri $UriGetProject -Method get -Headers $AzureDevOpsAuthenicationHeaderWrite-Host $GetProjectResult.name

4. After extract all Service Hooks, 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