Skip to content

Associate a maintenance configuration#

Operational Excellence · Virtual Machine · Rule · Preview · 2023_06 · Important

Use a maintenance configuration for virtual machines.

Description#

Virtual machines can be attached to a maintenance configuration which allows customer managed assessments and updates for machine patches within the guest operating system.

Recommendation#

Consider automatically managing and applying operating system updates by associating a maintenance configuration.

Examples#

Configure with Azure template#

To deploy virtual machines that pass this rule:

  • Deploy a Microsoft.Maintenance/configurationAssignments sub-resource (extension resource).
  • Set the properties.maintenanceConfigurationId property to the linked maintenance configuration resource Id.

For example:

Azure Template snippet
{
  "type": "Microsoft.Maintenance/configurationAssignments",
  "apiVersion": "2022-11-01-preview",
  "name": "[parameters('assignmentName')]",
  "location": "[parameters('location')]",
  "scope": "[format('Microsoft.Compute/virtualMachines/{0}', parameters('name'))]",
  "properties": {
    "maintenanceConfigurationId": "[parameters('maintenanceConfigurationId')]"
  },
  "dependsOn": [
    "[resourceId('Microsoft.Compute/virtualMachines', parameters('name'))]"
  ]
}

Configure with Bicep#

To deploy virtual machines that pass this rule:

  • Deploy a Microsoft.Maintenance/configurationAssignments sub-resource (extension resource).
  • Set the properties.maintenanceConfigurationId property to the linked maintenance configuration resource Id.

For example:

Azure Bicep snippet
resource config 'Microsoft.Maintenance/configurationAssignments@2022-11-01-preview' = {
  name: assignmentName
  location: location
  scope: vm
  properties: {
    maintenanceConfigurationId: maintenanceConfigurationId
  }
}

Notes#

Operating system updates with Update Management center is a preview feature. Not all operating systems are supported, check out the LINKS section for more information. Update management center doesn't support driver updates.

Comments