Forum Discussion
Sagar_Lad
May 16, 2020Brass Contributor
Create deployment group using Azure CLI/powershell and assign a VM in release pipeline
Hi Team, I have a requirement to create a release pipeline as below : I have a linux VM and I would like to automatically create a deployment group using azure cli/powershell and assign exist...
- May 21, 2020it looks like you want to create a deployment group using PowerShell
$baseUri = "https://dev.azure.com/{organisation}/{projectname}"
$accessToken = [System.Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes(":$($PersonalAccessToken)"))
$headers = @{
"Authorization" = "Basic $($accessToken)"
"Content-Type" = "application/json"
}
$uri = "$($baseUri)/_apis/distributedtask/deploymentgroups?api-version=5.1-preview.1"
$webResult = Invoke-WebRequest -Uri $uri -Method Get -Headers $headers -UseBasicParsing
Sagar_Lad
May 20, 2020Brass Contributor
Hi emreozanmemis ,
Thanks for sharing the link.
I have gone through the Microsoft link but it seems that links is more about how to install devops agent.
I am looking for an option create deployment group using powershell
atulram
May 21, 2020Brass Contributor
it looks like you want to create a deployment group using PowerShell
$baseUri = "https://dev.azure.com/{organisation}/{projectname}"
$accessToken = [System.Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes(":$($PersonalAccessToken)"))
$headers = @{
"Authorization" = "Basic $($accessToken)"
"Content-Type" = "application/json"
}
$uri = "$($baseUri)/_apis/distributedtask/deploymentgroups?api-version=5.1-preview.1"
$webResult = Invoke-WebRequest -Uri $uri -Method Get -Headers $headers -UseBasicParsing
$baseUri = "https://dev.azure.com/{organisation}/{projectname}"
$accessToken = [System.Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes(":$($PersonalAccessToken)"))
$headers = @{
"Authorization" = "Basic $($accessToken)"
"Content-Type" = "application/json"
}
$uri = "$($baseUri)/_apis/distributedtask/deploymentgroups?api-version=5.1-preview.1"
$webResult = Invoke-WebRequest -Uri $uri -Method Get -Headers $headers -UseBasicParsing