Share via


az maintenance configuration

Note

This reference is part of the maintenance extension for the Azure CLI (version 2.61.0 or higher). The extension will automatically install the first time you run an az maintenance configuration command. Learn more about extensions.

Manage maintenance configuration with maintenance.

Commands

Name Description Type Status
az maintenance configuration create

Create configuration record.

Extension GA
az maintenance configuration delete

Delete Configuration record.

Extension GA
az maintenance configuration list

List Configuration records within a subscription and resource group.

Extension GA
az maintenance configuration show

Get Configuration record.

Extension GA
az maintenance configuration update

Update configuration record.

Extension GA

az maintenance configuration create

Create configuration record.

az maintenance configuration create --name
                                    --resource-group
                                    [--duration]
                                    [--expiration-date-time]
                                    [--extension-properties]
                                    [--install-patches-linux-parameters]
                                    [--install-patches-windows-parameters]
                                    [--location]
                                    [--maintenance-scope {Extension, Host, InGuestPatch, OSImage, Resource, SQLDB, SQLManagedInstance}]
                                    [--maintenance-window-recur-every]
                                    [--maintenance-window-start-date-time]
                                    [--maintenance-window-time-zone]
                                    [--namespace]
                                    [--reboot-setting {Always, IfRequired, Never}]
                                    [--tags]
                                    [--visibility {Custom, Public}]

Examples

MaintenanceConfigurations_CreateOrUpdateForResource

az maintenance configuration create --location "westus2" --maintenance-scope "OSImage" --maintenance-window-duration "05:00" --maintenance-window-expiration-date-time "9999-12-31 00:00" --maintenance-window-recur-every "Day" --maintenance-window-start-date-time "2020-04-30 08:00" --maintenance-window-time-zone "Pacific Standard Time" --namespace "Microsoft.Maintenance" --visibility "Custom" --resource-group "examplerg" --resource-name "configuration1"

Required Parameters

--name --resource-name -n

Maintenance Configuration Name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--duration --maintenance-window-duration

Duration of the maintenance window in HH:mm format. If not provided, default value will be used based on maintenance scope provided. Example: 05:00.

--expiration-date-time --maintenance-window-expiration-date-time

Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59.

--extension-properties

Gets or sets extensionProperties of the maintenanceConfiguration Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--install-patches-linux-parameters --linux-parameters

Input parameters specific to patching Linux machine. For Windows machines, do not pass this property. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--install-patches-windows-parameters --windows-parameters

Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--location -l

Gets or sets location of the resource.

--maintenance-scope

Gets or sets maintenanceScope of the configuration.

Accepted values: Extension, Host, InGuestPatch, OSImage, Resource, SQLDB, SQLManagedInstance
--maintenance-window-recur-every --recur-every

Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6.

--maintenance-window-start-date-time --start-date-time

Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. The start date can be set to either the current date or future date. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone.

--maintenance-window-time-zone --time-zone

Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time.

--namespace

Gets or sets namespace of the resource.

--reboot-setting

Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after the patch operation is completed.

Accepted values: Always, IfRequired, Never
--tags

Gets or sets tags of the resource Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--visibility

Gets or sets the visibility of the configuration. The default value is 'Custom'.

Accepted values: Custom, Public
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az maintenance configuration delete

Delete Configuration record.

az maintenance configuration delete [--ids]
                                    [--name]
                                    [--resource-group]
                                    [--subscription]
                                    [--yes]

Examples

MaintenanceConfigurations_DeleteForResource

az maintenance configuration delete --resource-group "examplerg" --resource-name "example1"

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name --resource-name -n

Maintenance Configuration Name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az maintenance configuration list

List Configuration records within a subscription and resource group.

az maintenance configuration list [--resource-group]

Examples

MaintenanceConfigurations_List

az maintenance configuration list

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az maintenance configuration show

Get Configuration record.

az maintenance configuration show [--ids]
                                  [--name]
                                  [--resource-group]
                                  [--subscription]

Examples

MaintenanceConfigurations_GetForResource

az maintenance configuration show --resource-group "examplerg" --resource-name "configuration1"

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name --resource-name -n

Maintenance Configuration Name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az maintenance configuration update

Update configuration record.

az maintenance configuration update [--duration]
                                    [--expiration-date-time]
                                    [--extension-properties]
                                    [--ids]
                                    [--install-patches-linux-parameters]
                                    [--install-patches-windows-parameters]
                                    [--location]
                                    [--maintenance-scope {Extension, Host, InGuestPatch, OSImage, Resource, SQLDB, SQLManagedInstance}]
                                    [--maintenance-window-recur-every]
                                    [--maintenance-window-start-date-time]
                                    [--maintenance-window-time-zone]
                                    [--name]
                                    [--namespace]
                                    [--reboot-setting {Always, IfRequired, Never}]
                                    [--resource-group]
                                    [--subscription]
                                    [--tags]
                                    [--visibility {Custom, Public}]

Examples

MaintenanceConfigurations_UpdateForResource

az maintenance configuration update --location "westus2" --maintenance-scope "OSImage" --maintenance-window-duration "05:00" --maintenance-window-expiration-date-time "9999-12-31 00:00" --maintenance-window-recur-every "Month Third Sunday" --maintenance-window-start-date-time "2020-04-30 08:00" --maintenance-window-time-zone "Pacific Standard Time" --namespace "Microsoft.Maintenance" --visibility "Custom" --resource-group "examplerg" --resource-name "configuration1"

Optional Parameters

--duration --maintenance-window-duration

Duration of the maintenance window in HH:mm format. If not provided, default value will be used based on maintenance scope provided. Example: 05:00.

--expiration-date-time --maintenance-window-expiration-date-time

Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59.

--extension-properties

Gets or sets extensionProperties of the maintenanceConfiguration Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--install-patches-linux-parameters --linux-parameters

Input parameters specific to patching Linux machine. For Windows machines, do not pass this property. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--install-patches-windows-parameters --windows-parameters

Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--location -l

Gets or sets location of the resource.

--maintenance-scope

Gets or sets maintenanceScope of the configuration.

Accepted values: Extension, Host, InGuestPatch, OSImage, Resource, SQLDB, SQLManagedInstance
--maintenance-window-recur-every --recur-every

Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6.

--maintenance-window-start-date-time --start-date-time

Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. The start date can be set to either the current date or future date. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone.

--maintenance-window-time-zone --time-zone

Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time.

--name --resource-name -n

Maintenance Configuration Name.

--namespace

Gets or sets namespace of the resource.

--reboot-setting

Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after the patch operation is completed.

Accepted values: Always, IfRequired, Never
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Gets or sets tags of the resource Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--visibility

Gets or sets the visibility of the configuration. The default value is 'Custom'.

Accepted values: Custom, Public
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.