-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Labels
enhancementImprovements that do not include new featuresImprovements that do not include new featuresfeature requestfor new feature requests that do not just improve thingsfor new feature requests that do not just improve things
Description
Proposal
Please add support for creating, getting and setting "elasticPools". I want to create a Azure Automation Account runbook that sets minimum amount of VMSS / Azure DevOps self-hosted scale set agents to 1 during work hours, else 0. I planned to use VSTeam module, but don't think you have cmdlets for that yet?
Anyhow, here is a PowerShell example for getting a elasticPool:
# Set PAT
$PAT = [securestring](Read-Host -Prompt 'Paste PAT' -AsSecureString)
# Set TLS version
if ([System.Net.ServicePointManager]::SecurityProtocol.ToString() -ne 'Tls12') {
[System.Net.ServicePointManager]::SecurityProtocol = 'Tls12'
}
# Get pool
Invoke-RestMethod -Uri 'https://dev.azure.com/<redacted>/_apis/distributedtask/pools/<redacted>?api-version=7.0' -Method 'Get' -Headers @{
'Authorization' = [string] 'Basic {0}' -f (
[Convert]::ToBase64String(
[System.Text.Encoding]::UTF8.GetBytes(
':'+[System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($PAT))
)
)
)
}
# Get elasticPool
Invoke-RestMethod -Uri 'https://dev.azure.com/<redacted>/_apis/distributedtask/elasticPools/<redacted>?api-version=7.0' -Method 'Get' -Headers @{
'Authorization' = [string] 'Basic {0}' -f (
[Convert]::ToBase64String(
[System.Text.Encoding]::UTF8.GetBytes(
':'+[System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($PAT))
)
)
)
}And here are some documentation:
- https://learn.microsoft.com/en-us/rest/api/azure/devops/distributedtask/elasticpools/get?view=azure-devops-rest-7.0
- https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/scale-set-agents
Solved Problem
Would help me to scale VMSS ADO agents up and down.
Additional info / code snippets?
No response
Metadata
Metadata
Assignees
Labels
enhancementImprovements that do not include new featuresImprovements that do not include new featuresfeature requestfor new feature requests that do not just improve thingsfor new feature requests that do not just improve things