Closed erik-source closed 2 years ago
I'm not familiar with what you mean by an 'environment VM resource'. This project largely deals with the Azure DevOps Agent documented here.
I'm referring to Environment Virtual Machine Resources.
The docs you linked briefly touch on it in the Environments Only section (though they seem incomplete).
The registration script that it generates following the steps in the documentation seems to download and register an agent normally, but with the addition of the two environment options.
Here's a formatted snippet of what Azure DevOps generates as the registration script
# Ommitted for brevity
$Uri = 'https://vstsagentpackage.azureedge.net/agent/2.195.2/vsts-agent-win-x64-2.195.2.zip';
# Ommitted for brevity
.\config.cmd --environment `
--environmentname $EnvironmentName `
--agent $env:COMPUTERNAME `
--runasservice `
--work '_work' `
--url 'my-devops-url' `
--projectname 'my-project' `
--auth PAT `
--token $PAT;
Looks like a great feature to support, but not currently on the roadmap for our needs. More than happy to review a PR that adds support for these flags though! =)
Adding an 'AdditionalArguments' parameter would be good too - so that this API can be leveraged without it needing to stay in sync with the underlying tooling.
Thanks for the prompt replies! My powershell skills are lacking, but I'd certainly be willing to try my hand at a PR
Changes are now available on the PS gallery as of version 2.0.12-develop.
Will these tools support installing the agent as an environment VM resource?
The docs are sparse but pulling from the generated script this seems to mean supporting the options
--environment
and--environmentname "my-env"