Add an Azure SQL Database to an autofailover group

Add an Azure SQL Database to an autofailover group

  • 06/19/2019
  • 21 minutes to read

APPLIES TO:  Azure SQL Database

A failover group  is a declarative abstraction layer that allows you to group multiple geo-replicated databases. Learn to configure a failover group for an Azure SQL Database and test failover using either the Azure portal, PowerShell, or the Azure CLI. In this tutorial, you'll learn how to:

  • Create a database in Azure SQL Database
  • Create a failover group for the database between two servers.
  • Test failover.

Prerequisites

  • The portal
  • PowerShell
  • The Azure CLI

To complete this tutorial, make sure you have:

  • An Azure subscription.Create a free account if you don't already have one.

 

1 - Create a database

In this step, you create a logical SQL server and a single database that uses AdventureWorksLT sample data. You can create the database by using Azure portal menus and screens, or by using an Azure CLI or PowerShell script in the Azure Cloud Shell.

All the methods include setting up a server-level firewall rule to allow the public IP address of the computer you're using to access the server. For more information about creating server-level firewall rules, see Create a server-level firewall. You can also set database-level firewall rules. See Create a database-level firewall rule.

  • Portal
  • Azure CLI
  • PowerShell

To create a resource group, server, and single database in the Azure portal:

  1. Sign in to the portal.
  2. From the Search bar, search for and select Azure SQL.
  3. On the Azure SQL page, select Add.

Link to PDF : Diagnose and resolve latch contention on SQL Server