Use SQL Server Always On Availability Groups with Team Foundation Server

This topic provides general guidelines for enabling AlwaysOn Availability Groups with Team Foundation Server. AlwaysOn Availability Groups requires a small amount of TFS-specific configuration, which can help you provide high availability (HA) to TFS relational databases like TFS_Configuration and TFS_Collection database. The TFS-specific configuration sets the MultisubnetFailover option to true in the connection string that TFS uses for the data tier and is not necessary for providing HA support for reporting or SharePoint. To provide high availability to the TFS report server or SharePoint deployment, use the documentation for those products.

TFS support for AlwaysOn Availability Groups is an on or off proposition: if you use it, you must include your TFS_Configuration database as well as all of your TFS_Collection databases in the availability group. If you add a team project collection in the future, the database for that collection must be added to the availability group in SQL Server.

New for this release, TFS 2013 allows you to use more than one SQL Server availability group.

Use SQL Server documentation for guidance about configuring AlwaysOn Availability Groups. TFS does not require any specific AlwaysOn Availability Group configuration. Use the configuration that best meets your team’s needs and the recommendations found in SQL Server guidance. See Getting Started with AlwaysOn Availability Groups (SQL Server).

Setting up a new TFS installation with AlwaysOn Availability Groups

This a high level walkthrough of the steps required to implement AlwaysOn Availability Groups during TFS installation.

Tip

To set the MultisubnetFailover option to true in the connection string for an already running deployment of TFS, use the RegisterDB command of TFSConfig with the /usesqlalwayson argument. You will need to use the TFSService Control Command to stop and start TFS before you can set the MultisubnetFailover option. See RegisterDB Command and TFSServiceControl Command.

One: set up AlwaysOn Availability Groups

The SQL Server AlwaysOn Availability Group must be ready before you install TFS. See Getting Started with AlwaysOn Availability Groups (SQL Server)

Two: install TFS using the advanced wizard

Select AlwaysOn checkbox

If you’re installing TFS for the first time, use the Advanced configuration wizard, which gives you access to the SQL AlwaysOn Availability Group check box (pictured above). On this screen, enter the Availability Group Listener in the SQL Server Instance text box. TFS will create TFS_Configuration and the DefaultCollection databases on the Primary replica of your AlwaysOn Availability Group. The databases for SharePoint will also be created, if you allow TFS to install SharePoint Foundation.

Tip

You can also access the SQL AlwaysOn Availability Group check box by using the Application-Tier Only or Upgrade wizards. See How to: Create a Team Foundation server farm (high availability) or TFS upgrade requirements.

Three: add the new TFS databases to the AlwaysOn Availability Group

Add TFS databases to AlwaysOn Availibility Group

You’ll need to back up any databases that you want to add to the AlwaysOn Availability Group to bring them into compliance for data stored in an AlwaysOn Availability Group. Next, use the Availability Group Wizard to add the databases to the group. See Creation and Configuration of Availability Groups (SQL Server), and Use the New Availability Group Wizard (SQL Server Management Studio).

Tip

If you add a new team project collection to TFS, remember to add the database for the collection to your availability group in SQL Server. You cannot have some databases for team project collections in and some outside the availability group.

AlwaysOn Availability Groups Support for Reporting and SharePoint

The TFS-specific configurations described in this topic are not necessary to provide HA support for reporting or SharePoint. To provide AlwaysOn support for those features, use the guidance available for those products, or implement some other TFS-supported HA feature.

Reporting and AlwaysOn Availability Groups

SharePoint and HA