Concepts
To configure long-term backup retention for your Azure SQL Solutions, you can use the Azure Portal, PowerShell, or Azure CLI. This article will guide you through the process using all three methods.
Using Azure Portal:
- Sign in to the Azure Portal and navigate to your Azure SQL Solution resource.
- In the left-hand menu, select “Backup and restore.”
- Under “Long-term backup retention,” click on the “Configure” button.
- In the “Retention period” section, specify the number of days you want to retain backups. You can choose a value between 7 and 10,080 days.
- In the “Weekly retention” section, choose the day of the week that you want the system to take a full backup. You can enable up to four weekly backups.
- In the “Monthly retention” section, choose the week of the month and the day of the week when you want the system to take a full backup. You can enable up to 12 monthly backups.
- Click “Apply” to save your changes.
Using PowerShell:
Make sure you have the Azure PowerShell module installed and imported.
Connect-AzAccount
Select the Azure subscription containing your Azure SQL Solution:
Select-AzSubscription -SubscriptionName "YourSubscriptionName"
Set the context to your Azure SQL Solution:
Set-AzSqlDatabaseLongTermRetentionBackup -ResourceGroupName "YourResourceGroup" -ServerName "YourServerName" -DatabaseName "YourDatabaseName" -WeeklyRetention P7W -MonthlyRetention P12M -YearlyRetention P10Y
Note: Adjust the resource group, server name, database name, weekly retention (P7W), monthly retention (P12M), and yearly retention (P10Y) according to your requirements.
Using Azure CLI:
Ensure you have the Azure CLI installed and configured.
az login
Set the active subscription containing your Azure SQL Solution:
az account set --subscription "YourSubscriptionName"
Configure the long-term backup retention for your Azure SQL Solution using the following command:
az sql db ltr-policy set --name "YourDatabaseName" --server "YourServerName" --resource-group "YourResourceGroup" --weekly-retention P7W --monthly-retention P12M --yearly-retention P10Y
Note: Replace “YourDatabaseName,” “YourServerName,” “YourResourceGroup,” weekly retention (P7W), monthly retention (P12M), and yearly retention (P10Y) with your own values based on your specific configuration.
By following the steps using the Azure Portal, PowerShell, or Azure CLI, you can easily configure long-term backup retention for your Azure SQL Solution. This will ensure that you have reliable and secure backups of your data for extended periods, meeting your specific retention requirements.
Answer the Questions in Comment Section
True/False:
In Azure SQL Database, the long-term backup retention feature provides automatic backups for up to 35 years.
Answer: False
Single Select:
Which Azure SQL deployment option supports long-term backup retention?
- a) Azure SQL Database Single Database
- b) Azure SQL Managed Instance
- c) Azure SQL Database Hyperscale
- d) Azure SQL Database for PostgreSQL
Answer: b) Azure SQL Managed Instance
True/False:
Long-term backup retention in Azure SQL Database is enabled by default for all databases.
Answer: False
True/False:
The long-term backup retention feature in Azure SQL Database is available only in specific regions.
Answer: True
Multiple Select:
Which of the following retention periods can be configured for long-term backup retention in Azure SQL Database? (Select all that apply)
- a) 1 week
- b) 3 months
- c) 1 year
- d) 10 years
Answer: b) 3 months, c) 1 year, d) 10 years
Single Select:
What is the maximum retention period that can be configured for long-term backup retention in Azure SQL Database?
- a) 1 month
- b) 5 years
- c) 10 years
- d) 25 years
Answer: d) 25 years
True/False:
Long-term backup retention in Azure SQL Database is priced separately and incurs additional costs.
Answer: True
Single Select:
Which service is used to manage long-term backup retention in Azure SQL Database?
- a) Azure Backup
- b) Azure Site Recovery
- c) Azure Blob Storage
- d) Azure Recovery Services Vault
Answer: c) Azure Blob Storage
Multiple Select:
Which databases are eligible for long-term backup retention in Azure SQL Database? (Select all that apply)
- a) General Purpose
- b) Hyperscale
- c) Business Critical
- d) Serverless
Answer: a) General Purpose, b) Hyperscale, c) Business Critical
Single Select:
How many long-term backup retention policies can be applied to an Azure SQL Database?
- a) Only one
- b) Up to five
- c) Unlimited
- d) Depends on the database pricing tier
Answer: a) Only one
This blog on configuring long-term backup retention for Azure SQL was very helpful. Thanks!
Can someone explain the difference between long-term retention (LTR) and Point-in-Time Restore (PITR)?
Great guide! Just configured my LTR for 10 years. Azure makes it so easy.
Can LTR backups be copied to another region for disaster recovery?
The step-by-step screenshots in your blog were incredibly accurate. Thanks!
Is there an additional cost associated with LTR backups compared to regular backups?
I followed the instructions, but my backups are not showing in the LTR section. Any ideas?
This was very informative. Appreciate the clear instructions.