We have a dev server hosting webservices from multiple Azure DevOps projects. To use yaml deployment pipelines, we migrated from deployment pools to environments/resources. Unlike deployment pools neither environments nor resources can be shared between projects. You can upvote here to change that.
We work around this as follows.
Unfortunately, this creates a naming conflict if there is already an environment agent installed on the server.
The service already exists: vstsagent.MyDevOpsAccount..MyServer, it will be replaced
Error: Operation CreateService failed with return code 1072
TLDR: In the powershell installation script, change --agent $env:COMPUTERNAME to --agent "$env:COMPUTERNAME-MyProject"
The reason seems to be that the windows service name of the agent is determined as follows.
serviceName = StringUtil.Format(serviceNamePattern, accountName, settings.PoolName, settings.AgentName);
It uses the Azure DevOps organization name, the name of the deployment pool and the agent name. Since the organization name is fixed and the deployment pool name unavailable for environment agents, the agent name seems to be the only chance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With