maintenance_windows
Creates, updates, deletes, gets or lists a maintenance_windows resource.
Overview
| Name | maintenance_windows |
| Type | Resource |
| Id | azure.container_service.maintenance_windows |
Fields
The following fields are returned by SELECT queries:
- get
- list
- list_by_subscription
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
durationHours | integer | Length of the maintenance window in hours. Required. |
location | string | The geo-location where the resource lives. Required. |
notAllowedDates | array | Date ranges during which maintenance is not allowed. 'utcOffset' applies to these dates. For example, with 'utcOffset: +02:00' and a date span of '2026-12-23' to '2027-01-03', maintenance will be blocked from '2026-12-22 22:00' to '2027-01-03 22:00' in UTC time. |
provisioningState | string | The provisioning state of the maintenance window. Known values are: "Succeeded", "Failed", and "Canceled". (Succeeded, Failed, Canceled) |
schedule | object | Recurrence schedule for the maintenance window. One and only one of the schedule types should be specified: 'daily', 'weekly', 'absoluteMonthly', or 'relativeMonthly'. Required. |
startDate | string (date) | The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used. If not specified, the maintenance window will be active right away. |
startTime | string | The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
utcOffset | string | The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'. Note: this is a static offset and does not adjust for Daylight Saving Time. Customers in DST-observing regions should pick the offset that matches their preferred wall-clock time year-round; the maintenance window will shift by one hour relative to local time when DST starts or ends. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
durationHours | integer | Length of the maintenance window in hours. Required. |
location | string | The geo-location where the resource lives. Required. |
notAllowedDates | array | Date ranges during which maintenance is not allowed. 'utcOffset' applies to these dates. For example, with 'utcOffset: +02:00' and a date span of '2026-12-23' to '2027-01-03', maintenance will be blocked from '2026-12-22 22:00' to '2027-01-03 22:00' in UTC time. |
provisioningState | string | The provisioning state of the maintenance window. Known values are: "Succeeded", "Failed", and "Canceled". (Succeeded, Failed, Canceled) |
schedule | object | Recurrence schedule for the maintenance window. One and only one of the schedule types should be specified: 'daily', 'weekly', 'absoluteMonthly', or 'relativeMonthly'. Required. |
startDate | string (date) | The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used. If not specified, the maintenance window will be active right away. |
startTime | string | The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
utcOffset | string | The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'. Note: this is a static offset and does not adjust for Daylight Saving Time. Customers in DST-observing regions should pick the offset that matches their preferred wall-clock time year-round; the maintenance window will shift by one hour relative to local time when DST starts or ends. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
durationHours | integer | Length of the maintenance window in hours. Required. |
location | string | The geo-location where the resource lives. Required. |
notAllowedDates | array | Date ranges during which maintenance is not allowed. 'utcOffset' applies to these dates. For example, with 'utcOffset: +02:00' and a date span of '2026-12-23' to '2027-01-03', maintenance will be blocked from '2026-12-22 22:00' to '2027-01-03 22:00' in UTC time. |
provisioningState | string | The provisioning state of the maintenance window. Known values are: "Succeeded", "Failed", and "Canceled". (Succeeded, Failed, Canceled) |
schedule | object | Recurrence schedule for the maintenance window. One and only one of the schedule types should be specified: 'daily', 'weekly', 'absoluteMonthly', or 'relativeMonthly'. Required. |
startDate | string (date) | The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used. If not specified, the maintenance window will be active right away. |
startTime | string | The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
utcOffset | string | The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'. Note: this is a static offset and does not adjust for Daylight Saving Time. Customers in DST-observing regions should pick the offset that matches their preferred wall-clock time year-round; the maintenance window will shift by one hour relative to local time when DST starts or ends. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, maintenance_window_name, subscription_id | Gets the specified maintenance window. | |
list | select | resource_group_name, subscription_id | Lists maintenance windows in the specified resource group. | |
list_by_subscription | select | subscription_id | Lists maintenance windows in the specified subscription. | |
create_or_update | insert | resource_group_name, maintenance_window_name, subscription_id, location | Creates or updates a maintenance window. | |
update_tags | update | resource_group_name, maintenance_window_name, subscription_id | Updates tags on a maintenance window. | |
create_or_update | replace | resource_group_name, maintenance_window_name, subscription_id, location | Creates or updates a maintenance window. | |
delete | delete | resource_group_name, maintenance_window_name, subscription_id | Deletes a maintenance window. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
maintenance_window_name | string | The name of the maintenance window. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list
- list_by_subscription
Gets the specified maintenance window.
SELECT
id,
name,
durationHours,
location,
notAllowedDates,
provisioningState,
schedule,
startDate,
startTime,
systemData,
tags,
type,
utcOffset
FROM azure.container_service.maintenance_windows
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND maintenance_window_name = '{{ maintenance_window_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists maintenance windows in the specified resource group.
SELECT
id,
name,
durationHours,
location,
notAllowedDates,
provisioningState,
schedule,
startDate,
startTime,
systemData,
tags,
type,
utcOffset
FROM azure.container_service.maintenance_windows
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists maintenance windows in the specified subscription.
SELECT
id,
name,
durationHours,
location,
notAllowedDates,
provisioningState,
schedule,
startDate,
startTime,
systemData,
tags,
type,
utcOffset
FROM azure.container_service.maintenance_windows
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates or updates a maintenance window.
INSERT INTO azure.container_service.maintenance_windows (
tags,
location,
properties,
resource_group_name,
maintenance_window_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ resource_group_name }}',
'{{ maintenance_window_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: maintenance_windows
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the maintenance_windows resource.
- name: maintenance_window_name
value: "{{ maintenance_window_name }}"
description: Required parameter for the maintenance_windows resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the maintenance_windows resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
Properties of a maintenance window.
value:
provisioningState: "{{ provisioningState }}"
schedule:
daily:
intervalDays: {{ intervalDays }}
weekly:
intervalWeeks: {{ intervalWeeks }}
dayOfWeek: "{{ dayOfWeek }}"
absoluteMonthly:
intervalMonths: {{ intervalMonths }}
dayOfMonth: {{ dayOfMonth }}
relativeMonthly:
intervalMonths: {{ intervalMonths }}
weekIndex: "{{ weekIndex }}"
dayOfWeek: "{{ dayOfWeek }}"
startDate: "{{ startDate }}"
startTime: "{{ startTime }}"
durationHours: {{ durationHours }}
utcOffset: "{{ utcOffset }}"
notAllowedDates:
- start: "{{ start }}"
end: "{{ end }}"
UPDATE examples
- update_tags
Updates tags on a maintenance window.
UPDATE azure.container_service.maintenance_windows
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND maintenance_window_name = '{{ maintenance_window_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;
REPLACE examples
- create_or_update
Creates or updates a maintenance window.
REPLACE azure.container_service.maintenance_windows
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND maintenance_window_name = '{{ maintenance_window_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;
DELETE examples
- delete
Deletes a maintenance window.
DELETE FROM azure.container_service.maintenance_windows
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND maintenance_window_name = '{{ maintenance_window_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;