Unattended install of a Visual Studio Team Services (a.k.a. VSO) Build Agent

A while ago I was looking at installing the VSTS build Agent on Linux and was searching for the possibility to uninstall it unattended. I was doing this because I wanted to run my agent in a Docker container and on startup I wanted to run a configured agent. I solved ths by using an expect file on Linux. Take a look at my post how I did this.

Back then. There was no possibility for an unattended configuration in Windows as well. But as I was researching some stuff with the windows Build Agent, I found out that now there IS a possibility to configure the BuildAgent in script.

I downloaded the last version of the agent from my Visual Studio Team Services Account.

SNAGHTML11f8e902

And then In unpacked the zip to my local disk. In my case to c:\agent\

image

With a command prompt navigate to this directory and run

.\agent\VsoAgent.exe /? 

And you get a whole list of options

image

When you run

.\agent\VsoAgent.exe /configure 
/serverUrl:https://server.visualstudio.com 
/name:NameOfYourVSTSAgent
/Poolname:Default
/Login:<alternate username>,<alternate password>;AuthType=Basic 
/force 
/workfolder:"c:\agent\_work" 
/runningasservice:N 
/noprompt 
/force

 

You automatically configure a Build Agent against your VSTS account. Make sure you have set up Alternate credentials that you can use in this command line.

 

This is perfect when you want to test some builds locally. Create a batch file, run the file and you have a local build agent.

 

Happy building !

Advertisements

2 Responses to “Unattended install of a Visual Studio Team Services (a.k.a. VSO) Build Agent”

  1. HOW TO for the new vso agent. Team Services or TFS 2017 onprem… They’ve changed to way setup is launched. the config cmd launches bin\Agent.Listener.exe configure %* Looking at Agent.Listener.exe –HELP it shows details about setting up unattended mode installs. Read that for help.

Trackbacks/Pingbacks

  1. Running a VS Team Services (VSO) Build Agent in a Windows Docker Container | The Road to ALM - February 15, 2016

    […] This run.bat uses the environment variables and call the unattended install of the VSTS build agent as described in my earlier blogpost […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: