Skip to main content

maintenance_windows

Creates, updates, deletes, gets or lists a maintenance_windows resource.

Overview

Namemaintenance_windows
TypeResource
Idazure.container_service.maintenance_windows

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
durationHoursintegerLength of the maintenance window in hours. Required.
locationstringThe geo-location where the resource lives. Required.
notAllowedDatesarrayDate 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.
provisioningStatestringThe provisioning state of the maintenance window. Known values are: "Succeeded", "Failed", and "Canceled". (Succeeded, Failed, Canceled)
scheduleobjectRecurrence schedule for the maintenance window. One and only one of the schedule types should be specified: 'daily', 'weekly', 'absoluteMonthly', or 'relativeMonthly'. Required.
startDatestring (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.
startTimestringThe 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.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
utcOffsetstringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, maintenance_window_name, subscription_idGets the specified maintenance window.
listselectresource_group_name, subscription_idLists maintenance windows in the specified resource group.
list_by_subscriptionselectsubscription_idLists maintenance windows in the specified subscription.
create_or_updateinsertresource_group_name, maintenance_window_name, subscription_id, locationCreates or updates a maintenance window.
update_tagsupdateresource_group_name, maintenance_window_name, subscription_idUpdates tags on a maintenance window.
create_or_updatereplaceresource_group_name, maintenance_window_name, subscription_id, locationCreates or updates a maintenance window.
deletedeleteresource_group_name, maintenance_window_name, subscription_idDeletes 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.

NameDatatypeDescription
maintenance_window_namestringThe name of the maintenance window. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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

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
;