แชร์ผ่าน


az maintenance configuration

Note

This reference is part of the maintenance extension for the Azure CLI (version 2.67.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-name
                                    --resource-group
                                    [--duration --maintenance-window-duration]
                                    [--expiration-date-time --maintenance-window-expiration-date-time]
                                    [--extension-properties]
                                    [--install-patches-linux-parameters --linux-parameters]
                                    [--install-patches-windows-parameters --windows-parameters]
                                    [--location]
                                    [--maintenance-scope {Extension, Host, InGuestPatch, OSImage, Resource, SQLDB, SQLManagedInstance}]
                                    [--maintenance-window-recur-every --recur-every]
                                    [--maintenance-window-start-date-time --start-date-time]
                                    [--maintenance-window-time-zone --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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: MaintenanceWindow Arguments
--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.

Property Value
Parameter group: MaintenanceWindow Arguments
--extension-properties

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

Property Value
Parameter group: Properties 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.

Property Value
Parameter group: InstallPatches Arguments
--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.

Property Value
Parameter group: InstallPatches Arguments
--location -l

Gets or sets location of the resource.

Property Value
Parameter group: Configuration Arguments
--maintenance-scope

Gets or sets maintenanceScope of the configuration.

Property Value
Parameter group: Properties Arguments
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.

Property Value
Parameter group: MaintenanceWindow Arguments
--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.

Property Value
Parameter group: MaintenanceWindow Arguments
--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.

Property Value
Parameter group: MaintenanceWindow Arguments
--namespace

Gets or sets namespace of the resource.

Property Value
Parameter group: Properties Arguments
--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.

Property Value
Parameter group: InstallPatches Arguments
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.

Property Value
Parameter group: Configuration Arguments
--visibility

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

Property Value
Parameter group: Properties Arguments
Accepted values: Custom, Public
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az maintenance configuration delete

Delete Configuration record.

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

Examples

MaintenanceConfigurations_DeleteForResource

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

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: Resource Id Arguments
--name --resource-name -n

Maintenance Configuration Name.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
--yes -y

Do not prompt for confirmation.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az maintenance configuration show

Get Configuration record.

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

Examples

MaintenanceConfigurations_GetForResource

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

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: Resource Id Arguments
--name --resource-name -n

Maintenance Configuration Name.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

az maintenance configuration update

Update configuration record.

az maintenance configuration update [--duration --maintenance-window-duration]
                                    [--expiration-date-time --maintenance-window-expiration-date-time]
                                    [--extension-properties]
                                    [--ids]
                                    [--install-patches-linux-parameters --linux-parameters]
                                    [--install-patches-windows-parameters --windows-parameters]
                                    [--location]
                                    [--maintenance-scope {Extension, Host, InGuestPatch, OSImage, Resource, SQLDB, SQLManagedInstance}]
                                    [--maintenance-window-recur-every --recur-every]
                                    [--maintenance-window-start-date-time --start-date-time]
                                    [--maintenance-window-time-zone --time-zone]
                                    [--name --resource-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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: MaintenanceWindow Arguments
--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.

Property Value
Parameter group: MaintenanceWindow Arguments
--extension-properties

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

Property Value
Parameter group: Properties Arguments
--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.

Property Value
Parameter group: 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.

Property Value
Parameter group: InstallPatches Arguments
--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.

Property Value
Parameter group: InstallPatches Arguments
--location -l

Gets or sets location of the resource.

Property Value
Parameter group: Configuration Arguments
--maintenance-scope

Gets or sets maintenanceScope of the configuration.

Property Value
Parameter group: Properties Arguments
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.

Property Value
Parameter group: MaintenanceWindow Arguments
--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.

Property Value
Parameter group: MaintenanceWindow Arguments
--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.

Property Value
Parameter group: MaintenanceWindow Arguments
--name --resource-name -n

Maintenance Configuration Name.

Property Value
Parameter group: Resource Id Arguments
--namespace

Gets or sets namespace of the resource.

Property Value
Parameter group: Properties Arguments
--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.

Property Value
Parameter group: InstallPatches Arguments
Accepted values: Always, IfRequired, Never
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
--tags

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

Property Value
Parameter group: Configuration Arguments
--visibility

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

Property Value
Parameter group: Properties Arguments
Accepted values: Custom, Public
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False