2

Background:

This is a little known command available with the Team Foundation Server's command line utility. Essentially it lets you install team build services (along with controllers and agents) on a machine by passing in a configuration file. The syntax is

tfsconfig setup /install /unattendfile:{filepath}

The file looks like

<Configuration>
  <TeamBuild>
    <CollectionUri>
      <Uri>Url of your TFS project collection</Uri>
    </CollectionUri>
    <Credentials>
      <FullName></FullName>
      <Password></Password>
    </Credentials>
    <Controller>
      <ControllerName>Default Controller</ControllerName>
      <CustomAssemblyPath />
      <MaxConcurrentBuilds>0</MaxConcurrentBuilds>
    </Controller>
    <Agent>
      <AgentName>Agent 1 Name</AgentName>
      <ControllerName>Default Controller</ControllerName>
      <BuildDirectory>$(SystemDrive)\Builds\$(BuildAgentId)\$(BuildDefinitionPath)</BuildDirectory>
    </Agent>
      <!--AgentName>Agent 2 Name</AgentName>
      <ControllerName>Controller Name</ControllerName>
      <BuildDirectory>$(SystemDrive)\Builds\$(BuildAgentId)\$(BuildDefinitionPath)</BuildDirectory>
    </Agent>-->
    <Port>9191</Port>
    <UseSSL>False</UseSSL>
  </TeamBuild>
</Configuration>

In its current form it will configure TFS Build services on the machine on port 9191 with two agents.

Problem:

The way the config is setup, it will configure the build services on the machine with the url looking like

http://machinename:9191/v.....

my problem is that for some reason I want to be able to control the "machinename" or essentially the URL of the build service. I have a suspicion that it is possible by specifying another param in the config file but for the life of me I can't figure this out! Some help will be very welcome.

Nikhil
  • 3,304
  • 1
  • 25
  • 42
  • Can you give an example of what you'd like the URL to look like? – Dylan Smith Oct 03 '11 at 16:04
  • 1
    Actually the whole config file is generated run time by a process which then sends it to a WCF service on a build machine which configures an agent at run time. The URL will be http://{nameofmachine}-{ip}:9191/v{randomvalue} – Nikhil Oct 03 '11 at 17:50

2 Answers2

4

Unfortunately, unattended installation with tfsconfig isn't documented because it was not finished in 2010. We have plans to finish in the next release.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Buck Hodges
  • 3,342
  • 1
  • 19
  • 20
  • Thanks Buck. I actually work closely with MS PSFD from Reading, UK who had found this utility by approaching the TFS product group for our project needs. You mentioned that this wasn't finished in 2010, does this mean that this approach is in effect "unsupported"? – Nikhil Oct 11 '11 at 09:32
  • Thanks. Is there a way to achieve what I was trying to? – Nikhil Oct 13 '11 at 08:32
  • Not with tfsconfig in 2010. I am talking to the MS person you are working with to see what we can come up with given your constraints. – Buck Hodges Oct 13 '11 at 22:21
  • Thanks Buck. I was hoping to have this whole issue resolved by now but hey that's software for you eh! I have a call with that person today in about 20 minutes. Once I know where we are at, I will mark your reply as the accepted answer. – Nikhil Oct 17 '11 at 10:20
  • Buck Hodges I think this has been completed and implemented in TFS 2013 however I can't find any documentation on it. Is that correct? – Nikhil Nov 15 '13 at 15:09
  • Check out the blog post at http://blogs.msdn.com/b/visualstudioalm/archive/2012/10/12/unattended-installation-of-team-foundation-server-2012.aspx. – Buck Hodges Dec 09 '13 at 04:53
  • Thanks Buck. Saw that post but that is more for TFS 2012 whereas my problem is for TFS 2010. We are looking to adopt TFS 2013 soon. Will look to adopt this approach then. – Nikhil Dec 10 '13 at 09:39
2

there are some other (unsupported) methods to install agents per command-line you can find them here: other methods

Community
  • 1
  • 1
Jonas
  • 21
  • 1
  • The answer there just points back to my own thread here! But I quite liked the C# implementation the other thread points to. Will go through it properly – Nikhil Jun 18 '12 at 19:18