I’ve been messing around TFS2015RC these days, and one of the coolest new feature is the Build vNext Preview. However, it is not smooth sailing and one of the issues that cropped up was that the Build vNext Agent failed to install correctly during the setup process because I forgot to set up the proxy server, which led to the agent not being able to locate the TFS server (TF402467).
Heading back into the TFS Admin Console confirms this.
Attempts to “Change Account” or set the “Work Folder” would fail because of a “corrupt setting.json” file.
Digging into “C:\Program Files\Microsoft Team Foundation Server 14.0\Build” would show a setting.json with seemingly empty values. However, a ConfigureAgent.ps1 seems promising.
Call the powershell script, and provide the required values (assuming you have already sorted out the issue that caused the failure in the first place)
PS C:\Program Files\Microsoft Team Foundation Server 14.0\Build> ./ConfigureAgent.ps1
Enter the name for this agent (default is Agent-TFS2015RCDEMO):
Enter the url for the Team Foundation Server (default is ): http://localhost:8080/tfs
Configure this agent against which agent pool? (default pool name is ‘default’):
Enter the path of work folder for this agent (default is ‘C:\Program Files\Microsoft Team Foundation Server 14.0\Build\_
Would you like to install the agent as a Windows Service (Y/N) (default is Y):
Enter the name of the user account to use for the service (default is NT AUTHORITY\LocalService):
Would you like to unconfigure any existing agent (Y/N) (default is N; the agent will be updated):
Calling agent configure with /RunningAsService
Calling agent configure without /Force
Installing service vsoagent.localhost.Agent-TFS2015RCDEMO…
Service vsoagent.localhost.Agent-TFS2015RCDEMO has been successfully installed.
Creating EventLog source vsoagent.localhost.Agent-TFS2015RCDEMO in log Application…
Configure agent succeeded.
Agent is now running as a Windows Service.
PS C:\Program Files\Microsoft Team Foundation Server 14.0\Build>
Jumping back to the TFS Console Admin, we see that the Build vNext Agent has been set up and running. Yay! Hope this helps someone!