Microsoft.Maintenance maintenanceConfigurations 2022-07-01-preview

Bicep resource definition

The maintenanceConfigurations resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Maintenance/maintenanceConfigurations resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Maintenance/maintenanceConfigurations@2022-07-01-preview' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    extensionProperties: {}
    installPatches: {
      linuxParameters: {
        classificationsToInclude: [
          'string'
        ]
        packageNameMasksToExclude: [
          'string'
        ]
        packageNameMasksToInclude: [
          'string'
        ]
      }
      rebootSetting: 'string'
      tasks: {
        postTasks: [
          {
            parameters: {}
            source: 'string'
            taskScope: 'string'
          }
        ]
        preTasks: [
          {
            parameters: {}
            source: 'string'
            taskScope: 'string'
          }
        ]
      }
      windowsParameters: {
        classificationsToInclude: [
          'string'
        ]
        excludeKbsRequiringReboot: bool
        kbNumbersToExclude: [
          'string'
        ]
        kbNumbersToInclude: [
          'string'
        ]
      }
    }
    maintenanceScope: 'string'
    maintenanceWindow: {
      duration: 'string'
      expirationDateTime: 'string'
      recurEvery: 'string'
      startDateTime: 'string'
      timeZone: 'string'
    }
    namespace: 'string'
    visibility: 'string'
  }
}

Property values

maintenanceConfigurations

Name Description Value
name The resource name string (required)
location Gets or sets location of the resource string
tags Gets or sets tags of the resource Dictionary of tag names and values. See Tags in templates
properties Gets or sets properties of the resource MaintenanceConfigurationProperties

MaintenanceConfigurationProperties

Name Description Value
extensionProperties Gets or sets extensionProperties of the maintenanceConfiguration object
installPatches The input parameters to be passed to the patch run operation. This property only applies to Guest (InGuestPatch) scope. InputPatchConfiguration
maintenanceScope Gets or sets maintenanceScope of the configuration 'Extension'
'Host'
'InGuestPatch'
'OSImage'
'Resource'
'SQLDB'
'SQLManagedInstance'
maintenanceWindow Definition of a MaintenanceWindow MaintenanceWindow
namespace Gets or sets namespace of the resource string
visibility Gets or sets the visibility of the configuration. The default value is 'Custom' 'Custom'
'Public'

InputPatchConfiguration

Name Description Value
linuxParameters Input parameters specific to patching Linux machine. For Windows machines, do not pass this property. This property only applies to Guest (InGuestPatch) scope. InputLinuxParameters
rebootSetting 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. This property only applies to Guest (InGuestPatch) scope. 'Always'
'IfRequired'
'Never'
tasks [Not supported] Tasks information for the Software update configuration. SoftwareUpdateConfigurationTasks
windowsParameters Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property. This property only applies to Guest (InGuestPatch) scope. InputWindowsParameters

InputLinuxParameters

Name Description Value
classificationsToInclude Classification category of patches to be patched string[]
packageNameMasksToExclude Package names to be excluded for patching. string[]
packageNameMasksToInclude Package names to be included for patching. string[]

SoftwareUpdateConfigurationTasks

Name Description Value
postTasks [Not supported] List of post tasks. e.g. [{'source' :'runbook', 'taskScope': 'Resource', 'parameters': { 'arg1': 'value1'}}] TaskProperties[]
preTasks [Not supported] List of pre tasks. e.g. [{'source' :'runbook', 'taskScope': 'Global', 'parameters': { 'arg1': 'value1'}}] TaskProperties[]

TaskProperties

Name Description Value
parameters [Not supported] Gets or sets the parameters of the task. object
source [Not supported] Gets or sets the name of the runbook. string
taskScope [Not supported] Global Task execute once when schedule trigger. Resource task execute for each VM. 'Global'
'Resource'

InputWindowsParameters

Name Description Value
classificationsToInclude Classification category of patches to be patched string[]
excludeKbsRequiringReboot Exclude patches which need reboot bool
kbNumbersToExclude Windows KBID to be excluded for patching. string[]
kbNumbersToInclude Windows KBID to be included for patching. string[]

MaintenanceWindow

Name Description Value
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. string
expirationDateTime 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. string
recurEvery 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. string
startDateTime 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. string
timeZone 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. string

ARM template resource definition

The maintenanceConfigurations resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Maintenance/maintenanceConfigurations resource, add the following JSON to your template.

{
  "type": "Microsoft.Maintenance/maintenanceConfigurations",
  "apiVersion": "2022-07-01-preview",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "extensionProperties": {},
    "installPatches": {
      "linuxParameters": {
        "classificationsToInclude": [ "string" ],
        "packageNameMasksToExclude": [ "string" ],
        "packageNameMasksToInclude": [ "string" ]
      },
      "rebootSetting": "string",
      "tasks": {
        "postTasks": [
          {
            "parameters": {},
            "source": "string",
            "taskScope": "string"
          }
        ],
        "preTasks": [
          {
            "parameters": {},
            "source": "string",
            "taskScope": "string"
          }
        ]
      },
      "windowsParameters": {
        "classificationsToInclude": [ "string" ],
        "excludeKbsRequiringReboot": "bool",
        "kbNumbersToExclude": [ "string" ],
        "kbNumbersToInclude": [ "string" ]
      }
    },
    "maintenanceScope": "string",
    "maintenanceWindow": {
      "duration": "string",
      "expirationDateTime": "string",
      "recurEvery": "string",
      "startDateTime": "string",
      "timeZone": "string"
    },
    "namespace": "string",
    "visibility": "string"
  }
}

Property values

maintenanceConfigurations

Name Description Value
type The resource type 'Microsoft.Maintenance/maintenanceConfigurations'
apiVersion The resource api version '2022-07-01-preview'
name The resource name string (required)
location Gets or sets location of the resource string
tags Gets or sets tags of the resource Dictionary of tag names and values. See Tags in templates
properties Gets or sets properties of the resource MaintenanceConfigurationProperties

MaintenanceConfigurationProperties

Name Description Value
extensionProperties Gets or sets extensionProperties of the maintenanceConfiguration object
installPatches The input parameters to be passed to the patch run operation. This property only applies to Guest (InGuestPatch) scope. InputPatchConfiguration
maintenanceScope Gets or sets maintenanceScope of the configuration 'Extension'
'Host'
'InGuestPatch'
'OSImage'
'Resource'
'SQLDB'
'SQLManagedInstance'
maintenanceWindow Definition of a MaintenanceWindow MaintenanceWindow
namespace Gets or sets namespace of the resource string
visibility Gets or sets the visibility of the configuration. The default value is 'Custom' 'Custom'
'Public'

InputPatchConfiguration

Name Description Value
linuxParameters Input parameters specific to patching Linux machine. For Windows machines, do not pass this property. This property only applies to Guest (InGuestPatch) scope. InputLinuxParameters
rebootSetting 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. This property only applies to Guest (InGuestPatch) scope. 'Always'
'IfRequired'
'Never'
tasks [Not supported] Tasks information for the Software update configuration. SoftwareUpdateConfigurationTasks
windowsParameters Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property. This property only applies to Guest (InGuestPatch) scope. InputWindowsParameters

InputLinuxParameters

Name Description Value
classificationsToInclude Classification category of patches to be patched string[]
packageNameMasksToExclude Package names to be excluded for patching. string[]
packageNameMasksToInclude Package names to be included for patching. string[]

SoftwareUpdateConfigurationTasks

Name Description Value
postTasks [Not supported] List of post tasks. e.g. [{'source' :'runbook', 'taskScope': 'Resource', 'parameters': { 'arg1': 'value1'}}] TaskProperties[]
preTasks [Not supported] List of pre tasks. e.g. [{'source' :'runbook', 'taskScope': 'Global', 'parameters': { 'arg1': 'value1'}}] TaskProperties[]

TaskProperties

Name Description Value
parameters [Not supported] Gets or sets the parameters of the task. object
source [Not supported] Gets or sets the name of the runbook. string
taskScope [Not supported] Global Task execute once when schedule trigger. Resource task execute for each VM. 'Global'
'Resource'

InputWindowsParameters

Name Description Value
classificationsToInclude Classification category of patches to be patched string[]
excludeKbsRequiringReboot Exclude patches which need reboot bool
kbNumbersToExclude Windows KBID to be excluded for patching. string[]
kbNumbersToInclude Windows KBID to be included for patching. string[]

MaintenanceWindow

Name Description Value
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. string
expirationDateTime 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. string
recurEvery 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. string
startDateTime 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. string
timeZone 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. string

Terraform (AzAPI provider) resource definition

The maintenanceConfigurations resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Maintenance/maintenanceConfigurations resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Maintenance/maintenanceConfigurations@2022-07-01-preview"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      extensionProperties = {}
      installPatches = {
        linuxParameters = {
          classificationsToInclude = [
            "string"
          ]
          packageNameMasksToExclude = [
            "string"
          ]
          packageNameMasksToInclude = [
            "string"
          ]
        }
        rebootSetting = "string"
        tasks = {
          postTasks = [
            {
              parameters = {}
              source = "string"
              taskScope = "string"
            }
          ]
          preTasks = [
            {
              parameters = {}
              source = "string"
              taskScope = "string"
            }
          ]
        }
        windowsParameters = {
          classificationsToInclude = [
            "string"
          ]
          excludeKbsRequiringReboot = bool
          kbNumbersToExclude = [
            "string"
          ]
          kbNumbersToInclude = [
            "string"
          ]
        }
      }
      maintenanceScope = "string"
      maintenanceWindow = {
        duration = "string"
        expirationDateTime = "string"
        recurEvery = "string"
        startDateTime = "string"
        timeZone = "string"
      }
      namespace = "string"
      visibility = "string"
    }
  })
}

Property values

maintenanceConfigurations

Name Description Value
type The resource type "Microsoft.Maintenance/maintenanceConfigurations@2022-07-01-preview"
name The resource name string (required)
location Gets or sets location of the resource string
parent_id To deploy to a resource group, use the ID of that resource group. string (required)
tags Gets or sets tags of the resource Dictionary of tag names and values.
properties Gets or sets properties of the resource MaintenanceConfigurationProperties

MaintenanceConfigurationProperties

Name Description Value
extensionProperties Gets or sets extensionProperties of the maintenanceConfiguration object
installPatches The input parameters to be passed to the patch run operation. This property only applies to Guest (InGuestPatch) scope. InputPatchConfiguration
maintenanceScope Gets or sets maintenanceScope of the configuration "Extension"
"Host"
"InGuestPatch"
"OSImage"
"Resource"
"SQLDB"
"SQLManagedInstance"
maintenanceWindow Definition of a MaintenanceWindow MaintenanceWindow
namespace Gets or sets namespace of the resource string
visibility Gets or sets the visibility of the configuration. The default value is 'Custom' "Custom"
"Public"

InputPatchConfiguration

Name Description Value
linuxParameters Input parameters specific to patching Linux machine. For Windows machines, do not pass this property. This property only applies to Guest (InGuestPatch) scope. InputLinuxParameters
rebootSetting 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. This property only applies to Guest (InGuestPatch) scope. "Always"
"IfRequired"
"Never"
tasks [Not supported] Tasks information for the Software update configuration. SoftwareUpdateConfigurationTasks
windowsParameters Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property. This property only applies to Guest (InGuestPatch) scope. InputWindowsParameters

InputLinuxParameters

Name Description Value
classificationsToInclude Classification category of patches to be patched string[]
packageNameMasksToExclude Package names to be excluded for patching. string[]
packageNameMasksToInclude Package names to be included for patching. string[]

SoftwareUpdateConfigurationTasks

Name Description Value
postTasks [Not supported] List of post tasks. e.g. [{'source' :'runbook', 'taskScope': 'Resource', 'parameters': { 'arg1': 'value1'}}] TaskProperties[]
preTasks [Not supported] List of pre tasks. e.g. [{'source' :'runbook', 'taskScope': 'Global', 'parameters': { 'arg1': 'value1'}}] TaskProperties[]

TaskProperties

Name Description Value
parameters [Not supported] Gets or sets the parameters of the task. object
source [Not supported] Gets or sets the name of the runbook. string
taskScope [Not supported] Global Task execute once when schedule trigger. Resource task execute for each VM. "Global"
"Resource"

InputWindowsParameters

Name Description Value
classificationsToInclude Classification category of patches to be patched string[]
excludeKbsRequiringReboot Exclude patches which need reboot bool
kbNumbersToExclude Windows KBID to be excluded for patching. string[]
kbNumbersToInclude Windows KBID to be included for patching. string[]

MaintenanceWindow

Name Description Value
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. string
expirationDateTime 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. string
recurEvery 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. string
startDateTime 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. string
timeZone 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. string