Use SQL Server Always On Availability Groups
Azure DevOps Server 2022 | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018
This article provides general guidelines for enabling Always On Availability Groups with Azure DevOps Server. Always On Availability Groups requires a small amount of Azure DevOps Server-specific configuration, which can help you provide high availability (HA) to Azure DevOps Server relational databases like the TFS_Configuration and TFS_Collection databases. The Azure DevOps Server-specific configuration sets the MultisubnetFailover option to true in the connection string that Azure DevOps Server uses for the data tier. This configuration is not necessary for providing HA support for reporting or SharePoint. To provide high availability to the Azure DevOps Server report server or SharePoint deployment, see the documentation for those products.
Azure DevOps Server support for Always On 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 project collection in the future, the database for that collection must be added to the availability group in SQL Server.
You can have more than one SQL Server availability group.
See the SQL Server documentation for guidance about configuring Always On Availability Groups. Azure DevOps Server does not require any specific Always On Availability Group configuration. Use the configuration that best meets your team’s needs and the recommendations found in SQL Server guidance. For more information, see Getting started with Always On Availability Groups (SQL Server).
Set up a new Azure DevOps Server installation with Always On Availability Groups
The following is a high-level walkthrough of the steps required to implement Always On Availability Groups during Azure DevOps Server installation.
To set the MultisubnetFailover option to true in the connection string for an already running deployment of Azure DevOps Server, use the
RegisterDB command of TFSConfig with the
/usesqlalwayson argument. You'll need to use the TFSService Control Command to stop and start Azure DevOps Server before you can set the MultisubnetFailover option. For more information, see RegisterDB command and TFSServiceControl command.
One: set up Always On Availability Groups
The SQL Server Always On Availability Group must be ready before you install Azure DevOps Server. For more information, see Getting started with Always On Availability Groups (SQL Server).
Two: install Azure DevOps Server by using the Advanced wizard
If you’re installing Azure DevOps Server for the first time, use the Advanced configuration wizard, which gives you access to the SQL Always On Availability Group check box (shown above). On this screen, enter the Availability Group Listener in the SQL Server Instance text box. Azure DevOps Server creates TFS_Configuration and the DefaultCollection databases on the Primary replica of your Always On Availability Group. The databases for SharePoint are also created, if you allow Azure DevOps Server to install SharePoint Foundation.
Integration with SharePoint Products has been deprecated for TFS 2018 and later versions.
You can also access the SQL Always On Availability Group check box by using the Application-Tier Only or Upgrade wizards. For more information, see Create an Azure DevOps Server farm (high availability) or Upgrade requirements.
Three: add the new Azure DevOps Server databases to the Always On Availability Group
You’ll need to back up any databases that you want to add to the Always On Availability Group to bring them into compliance for data stored in an Always On Availability Group. Next, use the Availability Group wizard to add the databases to the group. For more information, see Creation and configuration of Availability Groups (SQL Server), and Use the Availability Group Wizard (SQL Server Management Studio).
If you add a new project collection to Azure DevOps Server, remember to add the database for the collection to your availability group in SQL Server. You cannot have some databases for project collections in and some outside the availability group.
Always On Availability Groups support for reporting and SharePoint
The Azure DevOps Server-specific configurations described in this article are not necessary to provide HA support for reporting or SharePoint. To provide Always On support for those features, use the guidance available for those products, or implement another Azure DevOps Server-supported HA feature.
Reporting and Always On Availability Groups
- Reporting Services with Always On Availability Groups (SQL Server)
- Analysis Services with Always On Availability Groups
SharePoint and HA