Associate a maintenance configuration#
Operational Excellence · Virtual Machine · 2023_06
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 Managment 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.
Links#
- Repeatable infrastructure
- About Update management center
- How to programmatically manage updates for Azure VMs
- Manage Update configuration settings
- Supported operating systems
- Azure deployment reference
Last update:
2023-05-10