0

I'm trying to create self-hosted windows private agents remotely on the VMs using ARM template & Deployment Group. I have created ARM template which will add the Team Services Agent as an extension successfully for the existing Windows VMs and could see that is getting added as an Target into Azure DevOps Deployment group and it is online as well, however i couldn't see that Agent under any Agent pools in Azure DevOps. Now i would need to associate that Agent to my build pipeline to execute the builds from that self-hosted agent?

PS NOTE: The reason i went with this approach is, Adding agent as custom script & agent installation using powershell or execute script using Run Command was not recommended by my client. Because basically these approaches required the main script to be stored in Storage account - so we can use SAS to call and execute them but using SAS itself was not recommended.

I have almost tried out all the ways of installing an agent remotely and in an automated-way. I should install the self-hosted windows Agent remotely and securely on the existing VM without logging in to VM and that agent should become an active agent so that I can associate that agent to my build pipelines.

Any suggestion will be helpful. Thanks.

praveen krish
  • 135
  • 2
  • 11
  • The online status in deployment group only indicates that the target machine is accessible. We can install more than one agent in target machine, so target machine and agent is not the same. To get the agent pool display the agent, you need to run the config.cmd. – LoLance Jan 23 '20 at 08:14
  • @Lance Li-MSFT So adding that TeamServicesAgent extension doesn't configure any Agents in to the Target machine, it just adds that extension for the VM and the agent folder, Isn't it ? So to run the config.cmd, Is there anyway that can I run it from remote or how can i achieve that remotely? Any thought please ?! Because I thought that will configure the agent as well so i can configure that with my build pipeline. – praveen krish Jan 23 '20 at 08:20
  • Sorry but I'm afraid you can't use current approach to get what you want... See [this](https://github.com/Microsoft/azure-pipelines-agent/issues/1714#issuecomment-406280694). – LoLance Jan 23 '20 at 08:50

1 Answers1

1

I have created ARM template which will add the Team Services Agent as an extension successfully for the existing Windows VMs and could see that is getting added as an Target into Azure DevOps Deployment group and it is online as well, however i couldn't see that Agent under any Agent pools in Azure DevOps.

Here's one similar issue from github.

According to the statement from RoopeshNair, Team Services Agent extension is designed to configures only deployment group agent.This extension never adds support for build & release agent configuration.

That's why you can find the target machine in Deployment Group but can't find it in agent pool.

You can use PS or CMD scripts to install the agent, but it seems that you don't want this direction. Then you may try this direction, check if Unattended config can help.

LoLance
  • 25,666
  • 1
  • 39
  • 73