Maintenance Windows - Create Or Update
Sets maintenance windows settings for a database.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current?maintenanceWindowName={maintenanceWindowName}&api-version=2023-08-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
database
|
path | True |
string |
The name of the database to set maintenance windows for. |
|
resource
|
path | True |
string |
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
|
server
|
path | True |
string |
The name of the server. |
|
subscription
|
path | True |
string |
The subscription ID that identifies an Azure subscription. |
|
api-version
|
query | True |
string |
The API version to use for the request. |
|
maintenance
|
query | True |
string |
Maintenance window name. |
Request Body
| Name | Type | Description |
|---|---|---|
| properties.timeRanges |
Maintenance window time range. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Successfully set maintenance windows settings. |
|
| Other Status Codes |
*** Error Responses: ***
|
Examples
Sets maintenance window settings for a selected database.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdwdb/maintenanceWindows/current?maintenanceWindowName=current&api-version=2023-08-01
{
"properties": {
"timeRanges": [
{
"dayOfWeek": "Saturday",
"startTime": "00:00:00",
"duration": "PT60M"
}
]
}
}
Sample response
Definitions
| Name | Description |
|---|---|
|
Day |
Day of maintenance window. |
|
Maintenance |
Maintenance windows. |
|
Maintenance |
Maintenance window time range. |
DayOfWeek
Day of maintenance window.
| Value | Description |
|---|---|
| Sunday | |
| Monday | |
| Tuesday | |
| Wednesday | |
| Thursday | |
| Friday | |
| Saturday |
MaintenanceWindows
Maintenance windows.
| Name | Type | Description |
|---|---|---|
| id |
string |
Resource ID. |
| name |
string |
Resource name. |
| properties.timeRanges |
Maintenance window time range. |
|
| type |
string |
Resource type. |
MaintenanceWindowTimeRange
Maintenance window time range.
| Name | Type | Description |
|---|---|---|
| dayOfWeek |
Day of maintenance window. |
|
| duration |
string |
Duration of maintenance window in minutes. |
| startTime |
string |
Start time minutes offset from 12am. |