General Availability: Maintenance window support for Azure SQL Database Hyperscale named replica.

  • Thread starter Thread starter Attinder_Pal_Singh
  • Start date Start date
A

Attinder_Pal_Singh

We are excited to announce that Hyperscale named replicas now support configuring a specific maintenance windows. You can now choose from predefined time slots for maintenance and setup alerts to be notified of upcoming maintenance events.

Why it matters: With named replicas, you can enhance your modern application architectures by scaling out read workloads to up to 30 read replicas. This reduces the load on the primary replica, allowing it to focus on write operations. Imagine multiple reader applications connecting to specific named replicas, each with its own unique business hours. This setup requires a tailored maintenance schedule, which minimizes downtime during crucial local business hours and prevents widespread disruptions.

Overview


By default, impactful updates to Azure SQL Database resources happen during the period 5PM to 8AM local time. Local time is determined by the location of Azure region that hosts the resource and may observe daylight saving time in accordance with local time zone definition. You can adjust the window for maintenance updates to a time suitable for your workload, by choosing from two non-default maintenance window slots:

  • Weekday window: 10:00 PM to 6:00 AM local time, Monday – Thursday
  • Weekend window: 10:00 PM to 6:00 AM local time, Friday – Sunday

Once the maintenance window selection is made, all planned maintenance events will only occur during the window of your choice.

Quick Start Guide


Maintenance window can be configured for existing named replicas through Azure portal, CLI, PowerShell, or RESTAPI.



NOTE: Setting a maintenance window during the creation of a new named replica is not supported.

Detailed information is available at Configure maintenance window. For convenience, here’s a quick start to configure maintenance window for named replica.

Azure Portal:

Here’s a screenshot of an existing Hyperscale named replica in East US2 region, with the available maintenance windows shown in the dropdown list. Select the desired maintenance window from the drop-down.

Attinder_Pal_Singh_0-1722853394373.png



Azure PowerShell

  • You can use below script to get a list of supported maintenance configurations for eastus2 region:



Code:
$location = "eastus2"
$configurations = Get-AzMaintenancePublicConfiguration
$configurations | ?{ $_.Location -eq $location -and $_.MaintenanceScope -eq "SQLDB"}





  • Script to check current maintenance window for your database.



Code:
$resourceGroupName = "YourResourceGroupName"
$serverName = "YourServerName"
$databaseName = "YourDatabaseName"
(Get-AzSqlDatabase -ResourceGroupName $resourceGroupName -ServerName $serverName -DatabaseName $databaseName).MaintenanceConfigurationId





  • Script to change the maintenance configuration of your database.



Set-AzSqlDatabase -ResourceGroupName $resourceGroupName -ServerName $serverName -DatabaseName $databaseName -MaintenanceConfigurationId "SQL_EastUS2_DB_2”





Azure CLI

  • Script to get a list of supported maintenance configurations for the eastus2 region:



Code:
location="eastus2"
resourceGroupName="your_resource_group_name"
serverName="your_server_name"
databaseName="your_db_name"
az maintenance public-configuration list --query "[?location=='$location'&&contains(maintenanceScope,'SQLDB')]"





  • Script to check current maintenance window for your database.



az sql db show --name $databaseName --resource-group $resourceGroupName --server $serverName --query "maintenanceConfigurationId"





  • Script to change the maintenance configuration of your database



Code:
# Select different maintenance window
maintenanceConfig="SQL_EastUS2_DB_2"
# Update database
az sql db update --resource-group $resourceGroupName --server $serverName --name $databaseName --maint-config-id $maintenanceConfig





Advance notifications (preview)

You can also configure alerts for Hyperscale named replica to notify you about upcoming planned maintenance events 24 hours in advance. More information on how to set up advance notification can be found here.



Conclusion

We hope you will find maintenance window for named replica useful for your Hyperscale databases. We would be happy to answer any questions you may have. Please leave a comment on this blog or email us at sqlhsfeedback AT microsoft DOT com.



References

Maintenance window - Azure SQL Database

Configure advance notifications for planned maintenance events - Azure SQL Database

Configure and manage Hyperscale named replicas


Continue reading...
 
Back
Top