A small selection of (unofficial. unsupported) demo scripts invoking the Update Management REST APIs
This demo uses a service principal.
The easiest way to use these snippets is via LinqPad. You will need to create an app.config with the following values defined:
<configuration>
<appSettings>
<add key="TenantId" value="" />
<add key="ClientId" value="servicePrincipalID" />
<add key="ClientSecret" value="servicePrincipal" />
<add key="SubscriptionId" value="" />
</appSettings>
</configuration>
The APIs themselves are documented here:
https://docs.microsoft.com/en-us/rest/api/automation/softwareupdateconfigurations
https://docs.microsoft.com/en-us/rest/api/automation/softwareupdateconfigurationruns
https://docs.microsoft.com/en-us/rest/api/automation/softwareupdateconfigurationmachineruns