Blog Post

VSTS - Offline Build Agent

Wednesday, October 26, 2016 5:13 AM

So you have started to look into the new build system for VSTS 2015 and have encountered some issues. In this post I’ll show you how I troubleshooted and fixed an offline build agent. If the following screenshot looks familiar then keep reading.

OfflineIt comes down to permissions. Below are the steps that you can follow to confirm and correct the problem.

1) Log onto the build machine where the remote agent is installed and verify the account used by the service is correct. Normally I would suggest that a dedicated account for TFS build be used here. If the agent is offline then the service will not be running. No point in starting it until we fix the issue so let’s keep digging.

2) Now visit the installation directory where the Agent was unzipped and installed. Open the ‘_diag’ folder to access the logs. Open the most recent log and scan through it. You will more than likely find an error like: ‘[Service Account] needs Listen permissions for pool [Name] to perform the action’ repeated through the log.

Log

3) Ok. Now we have identified the issue. We are missing a permission in the build configuration. Go back to the ‘Agent Pools’ page and expand your Pool to view the security groups. If you open the ‘Agent Pool Service Accounts’ you will more than likely see an empty group. Add your service account in there.

Service Account

 

3 alternative,

This is alternative solution that worked for me.

Run agent under user name and password using switch 

-runasservice --windowslogonaccount

IE: 

config.cmd --url https://my.visualstudio.com/ --auth PAT --token ph7s46partIsMissingxjw6pv6lwjr --pool default --agent AgentInCloud  --runasservice --windowslogonaccount username password

now the command will prompt you for credentials if they are not valid. 

4) Now switch back to your build server and start the “VSO…” service.

5) Finally refresh the Pools page and the agent should now be green and you can try your first TFS 2015 build. You should be good to go!

Happy Building!

Most of this article is based on article here:

http://www.modernadlm.com/tfs-build-2015-offline-build-agent/