You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/update-manager/manage-pre-post-events.md
+22-8Lines changed: 22 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,15 +33,20 @@ For example, if a maintenance schedule is set to start at **3:00 PM**, with the
33
33
34
34
|**Time**|**Details**|
35
35
|----------|-------------|
36
-
|2:19 PM | You can edit the machines and/or dynamically scope the machines up to 40 minutes before a scheduled patch run with an associated pre event. After this time, the resources will be included in the subsequent schedule run and not the current run. </br> **Note**</br> If you're creating a new schedule or editing an existing schedule with a pre event, you need at least 40 minutes prior to the maintenance window for the pre event to run. </br></br> In this example, if you have set a schedule at 3:00 PM, you can modify the scope 40 mins before the set time that is at, 2.19 PM. |
37
-
|2:30 PM | The pre event has 20 mins to complete before the patch installation begins to run. </br></br> In this example, the pre event is initiated at 2:30 PM.|
38
-
|2:50 PM | The pre event has 20 mins to complete before the patch installation begins to run. </br> **Note** </br> - If the pre event continues to run beyond 20 mins, the patch installation goes ahead irrespective of the pre event run status. </br> - If you choose to cancel the current run, you can cancel using the cancelation API 10 mins before the schedule. In this example, by 2:50 PM you can cancel either from your script or Azure function code. </br> If cancelation API fails to get invoked or hasn't been set up, the patch installation proceeds to run. </br> </br> In this example, the pre event should complete the tasks by 2:50 PM. If you choose to cancel the current run, the latest time that you can invoke the cancelation API is by 2:50 PM. |
36
+
|2:19 PM | You can edit the machines and/or dynamically scope the machines up to 40 minutes before a scheduled patch run with an associated pre event. If any changes are made to the resources attached to the schedule after this time, the resources will be included in the subsequent schedule run and not the current run. </br> **Note**</br> If you're creating a new schedule or editing an existing schedule with a pre event, you need at least 40 minutes prior to the maintenance window for the pre event to run. </br></br> In this example, if you have set a schedule at 3:00 PM, you can modify the scope 40 mins before the set time that is at, 2.19 PM. |
37
+
|Between 2:20 to 2:30 PM | The pre event is triggered giving atleast 20 mins to complete before the patch installation begins to run. </br></br> In this example, the pre event is initiated between 2:20 to 2:30 PM.|
38
+
|2:50 PM | The pre event has atleast 20 mins to complete before the patch installation begins to run. </br> **Note** </br> - If the pre event continues to run beyond 20 mins, the patch installation goes ahead irrespective of the pre event run status. </br> - If you choose to cancel the current run, you can cancel using the cancelation API 10 mins before the schedule. In this example, by 2:50 PM you can cancel either from your script or Azure function code. </br> If cancelation API fails to get invoked or hasn't been set up, the patch installation proceeds to run. </br> </br> In this example, the pre event should complete the tasks by 2:50 PM. If you choose to cancel the current run, the latest time that you can invoke the cancelation API is by 2:50 PM. |
39
39
|3:00 PM | As defined in the maintenance configuration, the schedule gets triggered at the specified time. </br> In this example, the schedule is triggered at 3:00 PM. |
40
40
|6:55 PM | The post event gets triggered after the defined maintenance window completes. If you have defined a shorter maintenance window of 2 hrs, the post maintenance event will trigger after 2 hours and if the maintenance schedule is completed before the stipulated time of 2 hours that is, in 1 hr 50 mins, the post event will start. </br></br> In this example, if the maintenance window is set to the maximum, then by 6:55 PM the patch installation process is complete and if you have a shorter maintenance window, the patch installation process is completed by 5:00 PM. |
41
41
|7:15 PM| After the patch installation, the post event runs for 20 mins. </br>In this example, the post event is initiated at 6:55 PM and completed by 7:15 PM and if you have a shorter maintenance window, the post event is triggered at 5:00 PM and completed by 5:20 PM. |
42
42
43
-
>[!IMPORTANT]
44
-
> Make sure to have atleast 40 minutes before the scheduled maintenance run time (3:00 PM in above example) otherwise it might lead to auto-cancellation of that particular scheduled run.
43
+
44
+
We recommend that you are watchful of the following:
45
+
+ If you're creating a new schedule or editing an existing schedule with a pre event, you need at least 40 minutes prior to the start of maintenance window (3PM in the above example) for the pre event to run otherwise it will lead to auto-cancellation of the current scheduled run.
46
+
+ Pre event is triggered 30 minutes before the scheduled patch run giving pre event atleast 20 minutes to complete.
47
+
+ Post event runs immediately after the patch installation completes.
48
+
+ To cancel the current patch run, use the cancellation API atleast 10 minutes before the schedule maintenance time.
49
+
45
50
46
51
## Configure pre and post events on existing schedule
47
52
@@ -61,6 +66,7 @@ You can configure pre and post events on an existing schedule and can add multip
61
66
1. On the **Create Event Subscription** page, enter the following details:
62
67
- In the **Event Subscription Details** section, provide an appropriate name.
63
68
- Keep the schema as **Event Grid Schema**.
69
+
- In the **Topic Details** section, provide an appropriate name to the **System Topic Name**.
64
70
- In the **Event Types** section, **Filter to Event Types**, select the event types that you want to get pushed to the endpoint or destination. You can select between **Pre Maintenance Event** and **Post Maintenance Event**.
65
71
- In the **Endpoint details** section, select the endpoint where you want to receive the response from. It would help customers to trigger their pre or post event.
66
72
@@ -70,6 +76,7 @@ You can configure pre and post events on an existing schedule and can add multip
70
76
71
77
> [!NOTE]
72
78
> - The pre and post event can only be created at a scheduled maintenance configuration level.
79
+
> - System Topic gets automatically created per maintenance configuration and all event subscription are linked to the System Topic in the EventGrid.
73
80
> - The pre and post event run falls outside of the schedule maintenance window.
74
81
75
82
## View pre and post events
@@ -100,6 +107,9 @@ To delete pre and post events, follow these steps:
100
107
101
108
:::image type="content" source="./media/manage-pre-post-events/delete-event-inline.png" alt-text="Screenshot that shows how to delete the pre and post events." lightbox="./media/manage-pre-post-events/delete-event-expanded.png":::
102
109
110
+
> [!NOTE]
111
+
> - If all the pre and post events are deleted from the maintenance configuration, System Topic gets automatically deleted from the EventGrid.
112
+
> - We recommend that you avoid deleting the System Topic manually from the EventGrid service.
103
113
104
114
## Cancel a schedule from a pre event
105
115
@@ -131,13 +141,17 @@ The following query allows you to view the list of VMs for a given schedule or a
131
141
```kusto
132
142
maintenanceresources
133
143
| where type =~ "microsoft.maintenance/maintenanceconfigurations/applyupdates"
134
-
| where properties.correlationId has "/subscriptions/<your-s-id> /resourcegroups/<your-rg-id> /providers/microsoft.maintenance/maintenanceconfigurations/<mc-name> /providers/microsoft.maintenance/applyupdates/"
144
+
| where properties.correlationId has "/subscriptions/your-s-id/resourcegroups/your-rg-id/providers/microsoft.maintenance/maintenanceconfigurations/mc-name/providers/microsoft.maintenance/applyupdates/"
135
145
| order by name desc
136
146
```
137
147
138
-
:::image type="content" source="./media/manage-pre-post-events/cancelation-api-user-inline.png" alt-text="Screenshot for cancelation done by the user." lightbox="./media/manage-pre-post-events/cancelation-api-user-expanded.png" :::
148
+
:::image type="content" source="./media/manage-pre-post-events/cancelation-api-user-inline.png" alt-text="Screenshot for cancelation done by the user." lightbox="./media/manage-pre-post-events/cancelation-api-user-expanded.png" :::
149
+
150
+
+`your-s-id` : Subscription ID in which maintenance configuration with Pre or post event is created
151
+
+`your-rg-id` : Resource Group Name in which maintenance configuration is created
152
+
+`mc-name` : Name of maintenance configuration in pre event is created
139
153
140
-
If the maintenance job is canceled by the system due to any reason, the error message in the JSON is obtained from the Azure Resource Graph for the corresponding maintenance configuration would be **Maintenance schedule canceled due to internal platform failure**.
154
+
If the maintenance job is canceled by the system due to any reason, the error message in the JSON is obtained from the Azure Resource Graph for the corresponding maintenance configuration would be **Maintenance schedule canceled due to internal platform failure**.
Copy file name to clipboardExpand all lines: articles/update-manager/pre-post-scripts-overview.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ The pre and post events in Azure Update Manager allow you to perform certain tas
19
19
20
20
The pre-events run before the patch installation begins and the post-events run after the patch installation ends. If the VM requires a reboot, it happens before the post-event begins.
21
21
22
-
Update Manager uses [Event Grid](../event-grid/overview.md) to create and manage pre and post events on scheduled maintenance configurations. In the Event Grid, you can choose from Azure Webhooks, Azure Functions, Storage accounts, and Event hub to trigger your pre and post activity. If you're using pre and post events in Azure Automation Update management and plan to move to Azure Update Manager, we recommend that you use Azure Webhooks linked to Automation Runbooks.
22
+
Update Manager uses [Event Grid](../event-grid/overview.md) to create and manage pre and post events on scheduled maintenance configurations. In the Event Grid, you can choose from Azure Webhooks, Azure Functions, Storage accounts, and Event hub to trigger your pre and post activity. **If you're using pre and post events in Azure Automation Update management and plan to move to Azure Update Manager, we recommend that you use Azure Webhooks linked to Automation Runbooks.**
23
23
24
24
## User scenarios
25
25
@@ -55,6 +55,6 @@ The following are the scenarios where you can define pre and post events:
55
55
56
56
## Next steps
57
57
58
-
- Troubleshoot issues, see [Troubleshoot Update Manager](troubleshoot.md).
59
58
- Manage the [pre and post maintenance configuration events](manage-pre-post-events.md)
59
+
- Troubleshoot issues, see [Troubleshoot Update Manager](troubleshoot.md).
60
60
- Learn on the [common scenarios of pre and post events](pre-post-events-common-scenarios.md)
0 commit comments