Configure Long Term Retention For Azure SQL Database

Introduction

Every business needs a backup policy to overcome the problems of any unexpected failures. There are multiple services that Azure provides us to store the data.

Azure automated backups store the database backups automatically from 7-35 days based on the tier you have chosen for your Azure SQL database.

However, there might be regulatory or compliance requirements, where you might want to store the backup for more than a year or so. This is where one of the new features of Recovery Services comes handy.

In this article, we will learn how to configure long-term backup retention in Azure SQL database.

The steps are given below, which are required for the configuration.

  • Create a Recovery Services Vault. (in the same Resource Group, where your logical SQL Server is located).
  • Long-term backup retention – Accept Privacy Terms.
  • Configure SQL Server (and the databases) to use the Recovery Services vault.
  • Create a retention policy.

Step 1

Create a Recovery Services Vault

Search for “Backup and Site recovery”, as shown below.

Vault

As shown below, select “Backup and Site Recovery (OMS)”.

Vault

As shown below, click “Create” to navigate to the “Create Recovery Services vault”.

Vault

Vault

Please make sure that the location and resource group of the Recovery Services vault are the same, where SQL Server and its databases are located.

As shown in the below screenshot, the Recovery Services value has been successfully created.

Vault

Step 2
 
Long-term backup retention Accept Privacy Terms

The feature Long-term backup retention is still in preview. Thus, you need to accept the Privacy terms.

Navigate to the SQL Server for which you would like to configure Long-term backup retention Service, as shown below.

Vault

Clicking on the long-term backup retention blade will take you to the blade, as shown below.

Vault

The Configure button is disabled. You can configure the retention policy only after accepting the privacy terms. As shown in the above screen capture, click “Preview terms Not Accepted".

To sign up for preview, click here to navigate to the Preview terms blade, as shown below.

Vault

Click the checkbox and click OK button, as shown above.

Accepting the terms will enable the “Configure” button, as shown below.

Vault

Step 3
 
Configure SQL Server (and the databases) to use the Recovery Services vault.

Click Configure button, as shown above to configure the Recovery Service value.

Clicking on the “Configure” button will take you to the Configure blade, as shown below.

Vault

As shown above, select the “Recovery Services value” and click on the “Select” button.

Step 4
 
Create a retention policy

You need to create a Retention Policy or select an existing policy. Currently, we don’t have any policies. Let’s go ahead and create a new Retention policy by providing a meaningful name and select the number of years, where you would like to retain the backup.

In this case, I have chosen 5 years.

Vault

Now, click OK button to complete the process of configuration.

Vault

Now, select the databases, which you would notice to retain and click Save button to save the changes. A confirmation box is displayed, as shown below.

Vault
Click OK to save the changes.

Vault

As shown above, a confirmation message is displayed about the retention policy.

You can see the details about the backup, which we have configured in the Recovery Services vault after a week.

Summary
  1. We created a new Recovery Service vault.
  2. We configured SQL server to the Recovery Service vault.
  3. Create a retention policy
  4. Select the databases, where you would like to attach the retention policy of the Recovery Services vault.

You can read the original post here.

I hope, you enjoyed reading the article. Your feedback is appreciated.


Similar Articles