Azure Maintenance Configuration as an Event Grid source

This article provides the properties and schema for Azure Maintenance Configurations events. For an introduction to event schemas, see Azure Event Grid event schema. It also gives you links to articles to use Maintenance Configuration as an event source.

Available event types

Maintenance Configuration emits the following event types:

Event type Description
Microsoft.Maintenance.PreMaintenanceEvent Raised before maintenance job start and gives user an opportunity to perform pre maintenance operations.
Microsoft.Maintenance.PostMaintenanceEvent Raised after maintenance job completes and gives an opportunity to perform post maintenance operations.

Example event

Following is an example for a schema of a pre-maintenance event:

[{ 
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Maintenance/maintenanceConfigurations/contosomaintenanceconfiguration/providers/microsoft.maintenance/applyupdates/20230509150000", 
  "source": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Maintenance/maintenanceConfigurations/contosomaintenanceconfiguration", 
  "subject": "contosomaintenanceconfiguration", 
"data": 
{ 
   "CorrelationId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Maintenance/maintenanceConfigurations/contosomaintenanceconfiguration/providers/microsoft.maintenance/applyupdates/20230509150000",  
   "MaintenanceConfigurationId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Maintenance/maintenanceConfigurations/contosomaintenanceconfiguration",  
   "StartDateTime": "2023-05-09T15:00:00Z",  
   "EndDateTime": "2023-05-09T18:55:00Z",  
   "CancellationCutOffDateTime": "2023-05-09T14:59:00Z",  
   "ResourceSubscriptionIds": ["subscription guid 1", "subscription guid 2"] 
} 
"type": "Microsoft.Maintenance.PreMaintenanceEvent", 
"time": "2023-05-09T14:25:00.3717473Z", 
  "specversion": "1.0" 
}] 

Following is an example for a post maintenance event:

[{ 
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Maintenance/maintenanceConfigurations/contosomaintenanceconfiguration/providers/microsoft.maintenance/applyupdates/20230509150000", 
  "source": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Maintenance/maintenanceConfigurations/contosomaintenanceconfiguration", 
  "subject": "contosomaintenanceconfiguration", 
"data": 
{ 
   "CorrelationId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Maintenance/maintenanceConfigurations/contosomaintenanceconfiguration/providers/microsoft.maintenance/applyupdates/20230509150000",  
   "MaintenanceConfigurationId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Maintenance/maintenanceConfigurations/contosomaintenanceconfiguration",  
   "Status": "Succeeded", 
   "StartDateTime": "2023-05-09T15:00:00Z",  
   "EndDateTime": "2023-05-09T18:55:00Z",  
   "ResourceSubscriptionIds": ["subscription guid 1", "subscription guid 2"] 
} 
"type": "Microsoft.Maintenance.PostMaintenanceEvent", 
"time": "2023-05-09T15:55:00.3717473Z", 
  "specversion": "1.0" 
}] 

Event properties

An event has the following top-level data:

Property Type Description
source string Full resource path to the event source. This field isn't writeable. Event Grid provides this value.
subject string Publisher-defined path to the event subject.
type string One of the registered event types for this event source.
time string The time the event is generated based on the provider's UTC time.
ID string Unique identifier for the event.
data object App Configuration event data.
specversion string CloudEvents schema specification version.

The data object has the following properties:

Property Type Description
CorrelationId string The resource ID of specific maintenance schedule instance.
MaintenanceConfigurationId string The resource ID of maintenance configuration.
StartDateTime string The maintenance schedule start time.
EndDateTime string The maintenance schedule end time.
CancellationCutOffDateTime string The maintenance schedule instance cancellation cut-off time.
ResourceSubscriptionIds string The subscription IDs from which VMs are included in this schedule instance.
Status string The completion status of maintenance schedule instance.

Next steps