I am working on script to get deployment from Azure DevOps for selected Azure DevOps Deployment group and Selected target machine
following Used rest api url does not provide required data -
$connectionToken = ""
$Url1 = "https://dev.azure.com/{Org Name}{Project Name}/_apis/distributedtask/deploymentgroups?
name={name}&api-version=6.0-preview.1"
$base64AuthInfo=
[System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($connectionToken)"))
$json = Invoke-RestMethod -Uri $Url1 -Headers @{authorization = "Basic $base64AuthInfo"} -Method Get
$data = $json | ConvertTo-Json -Depth 100
$data
What rest api url changes I need to do for getting required data ?
You could try the following URL to get the deployment Jobs :
You could get the
deploygroup idandtarget machine idin the Azure Devops url:mgid =
deploygroup idmachineid =target machine id.Here is the Powershell Example:
Result: