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/tutorial-webhooks-using-runbooks.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,9 +34,9 @@ In this tutorial, you learn how to:
34
34
35
35
1.[Create](../automation/manage-runbooks.md#create-a-runbook) and [Publish](../automation/manage-runbooks.md#publish-a-runbook) an Automation runbook.
36
36
37
-
1. If you were using Runbooks that were being used for [pre or post tasks](../automation/update-management/pre-post-scripts.md) in Azure Automation and Update Management, it's critical that you follow the below steps to avoid an unexpected impact to your machines and failed maintenance runs.
37
+
1. If you were using Runbooks that were being used for [pre or post tasks](../automation/update-management/pre-post-scripts.md) in Azure Automation Update Management, it's critical that you follow the below steps to avoid an unexpected impact to your machines and failed maintenance runs.
38
38
39
-
1. For your runbooks, parse the webhook payload to ensure that it's triggering on **Microsoft.Maintenance.PreMaintenanceEvent** or **Microsoft.Maintenance.PostMaintenanceEvent** events only. By design webhooks are triggered on other subscription events if any other event is added with the same endpoint.
39
+
1. For your runbooks, parse the webhook payload to ensure that it's triggering on **Microsoft.Maintenance.PreMaintenanceEvent** or **Microsoft.Maintenance.PostMaintenanceEvent** events only. By design webhooks are triggered on other subscription events if any other event is added with the same endpoint.
40
40
- See the [Azure Event Grid event schema](../event-grid/event-schema.md).
41
41
- See the [Event Grid schema specific to Maintenance configurations](../event-grid/event-schema-maintenance-configuration.md)
42
42
- See the code listed below:
@@ -55,12 +55,11 @@ In this tutorial, you learn how to:
55
55
56
56
if ($eventType -ne “Microsoft.Maintenance.PreMaintenanceEvent” -or $eventType –ne “Microsoft.Maintenance.PostMaintenanceEvent” ) {
57
57
Write-Output "Webhook not triggered as part of pre or post patching for maintenance run"
58
-
59
58
return
60
59
}
61
60
```
62
61
63
-
1. **SoftwareUpdateConfigurationRunContext** parameter, which contains information about list of machines in the update deployment won't be passed to the pre or post scripts when you use them for pre or post events while using automation webhook. You can either query the list of machines from Azure Resource Graph or have the list of machines coded in the scripts.
62
+
1. [**SoftwareUpdateConfigurationRunContext**](../automation/update-management/pre-post-scripts.md#softwareupdateconfigurationruncontext-properties) parameter, which contains information about list of machines in the update deployment won't be passed to the pre or post scripts when you use them for pre or post events while using automation webhook. You can either query the list of machines from Azure Resource Graph or have the list of machines coded in the scripts.
64
63
65
64
- Ensure that proper roles and permissions are granted to the managed identities that you're using in the script, to execute Resource Graph queries and to start or stop machines.
66
65
- See the permissions related to [resource graph queries](../governance/resource-graph/overview.md#permissions-in-azure-resource-graph)
@@ -108,7 +107,8 @@ In this tutorial, you learn how to:
108
107
if ($allMachines.Count -eq 0) {
109
108
Write-Output "No Machines were found."
110
109
break
111
-
}
110
+
}
111
+
}
112
112
```
113
113
114
114
1. To customize you can use either your existing scripts with the above modifications done or use the following scripts.
0 commit comments