Share via


Machines - Install Patches

The operation to install patches on a hybrid machine identity in Azure.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches?api-version=2025-01-13

URI Parameters

Name In Required Type Description
name
path True

string

The name of the hybrid machine.

resourceGroupName
path True

string

The name of the resource group.

subscriptionId
path True

string

minLength: 1

The ID of the target subscription.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Required Type Description
maximumDuration True

string

Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours)

rebootSetting True

VMGuestPatchRebootSetting

Defines when it is acceptable to reboot a VM during a software update operation.

linuxParameters

LinuxParameters

Input for InstallPatches on a Linux VM, as directly received by the API

windowsParameters

WindowsParameters

Input for InstallPatches on a Windows VM, as directly received by the API

Responses

Name Type Description
200 OK

MachineInstallPatchesResult

OK

202 Accepted

HTTP 202 (Accepted) if the operation was successfully started and will complete asynchronously.

Headers

Location: string

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Install patch state of a machine.

Sample request

POST https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroupName/providers/Microsoft.HybridCompute/machines/myMachineName/installPatches?api-version=2025-01-13

{
  "maximumDuration": "PT4H",
  "rebootSetting": "IfRequired",
  "windowsParameters": {
    "classificationsToInclude": [
      "Critical",
      "Security"
    ],
    "maxPatchPublishDate": "2021-08-19T02:36:43.0539904+00:00"
  }
}

Sample response

{
  "status": "Succeeded",
  "installationActivityId": "68f8b292-dfc2-4646-9781-33cc88631968",
  "rebootStatus": "Completed",
  "maintenanceWindowExceeded": false,
  "excludedPatchCount": 0,
  "notSelectedPatchCount": 0,
  "pendingPatchCount": 2,
  "installedPatchCount": 3,
  "failedPatchCount": 0,
  "startDateTime": "2021-08-22T02:15:06.9740000Z",
  "lastModifiedDateTime": "2021-08-22T02:16:06.9740000Z",
  "startedBy": "User",
  "osType": "Windows",
  "errorDetails": null
}
Location: eastus2euap

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

LinuxParameters

Input for InstallPatches on a Linux VM, as directly received by the API

MachineInstallPatchesParameters

Input for InstallPatches as directly received by the API

MachineInstallPatchesResult

The result summary of an installation operation.

OsType

The operating system type of the machine.

PatchOperationStartedBy

Indicates if operation was triggered by user or by platform.

PatchOperationStatus

The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings."

PatchServiceUsed

Specifies the patch service used for the operation.

VMGuestPatchClassification_Linux

The update classifications to select when installing patches for Linux.

VMGuestPatchClassification_Windows

The update classifications to select when installing patches for Windows.

VMGuestPatchRebootSetting

Defines when it is acceptable to reboot a VM during a software update operation.

VMGuestPatchRebootStatus

The reboot state of the VM following completion of the operation.

WindowsParameters

Input for InstallPatches on a Windows VM, as directly received by the API

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

LinuxParameters

Input for InstallPatches on a Linux VM, as directly received by the API

Name Type Description
classificationsToInclude

VMGuestPatchClassification_Linux[]

The update classifications to select when installing patches for Linux.

packageNameMasksToExclude

string[]

packages to exclude in the patch operation. Format: packageName_packageVersion

packageNameMasksToInclude

string[]

packages to include in the patch operation. Format: packageName_packageVersion

MachineInstallPatchesParameters

Input for InstallPatches as directly received by the API

Name Type Description
linuxParameters

LinuxParameters

Input for InstallPatches on a Linux VM, as directly received by the API

maximumDuration

string

Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours)

rebootSetting

VMGuestPatchRebootSetting

Defines when it is acceptable to reboot a VM during a software update operation.

windowsParameters

WindowsParameters

Input for InstallPatches on a Windows VM, as directly received by the API

MachineInstallPatchesResult

The result summary of an installation operation.

Name Type Description
errorDetails

ErrorDetail

The errors that were encountered during execution of the operation. The details array contains the list of them.

excludedPatchCount

integer (int32)

The number of patches that were not installed due to the user blocking their installation.

failedPatchCount

integer (int32)

The number of patches that could not be installed due to some issue. See errors for details.

installationActivityId

string

The activity ID of the operation that produced this result.

installedPatchCount

integer (int32)

The number of patches successfully installed.

lastModifiedDateTime

string (date-time)

The UTC timestamp when the operation finished.

maintenanceWindowExceeded

boolean

Whether the operation ran out of time before it completed all its intended actions.

notSelectedPatchCount

integer (int32)

The number of patches that were detected as available for install, but did not meet the operation's criteria.

osType

OsType

The operating system type of the machine.

patchServiceUsed

PatchServiceUsed

Specifies the patch service used for the operation.

pendingPatchCount

integer (int32)

The number of patches that were identified as meeting the installation criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true.

rebootStatus

VMGuestPatchRebootStatus

The reboot state of the VM following completion of the operation.

startDateTime

string (date-time)

The UTC timestamp when the operation began.

startedBy

PatchOperationStartedBy

Indicates if operation was triggered by user or by platform.

status

PatchOperationStatus

The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings."

OsType

The operating system type of the machine.

Value Description
Windows
Linux

PatchOperationStartedBy

Indicates if operation was triggered by user or by platform.

Value Description
User
Platform

PatchOperationStatus

The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings."

Value Description
Unknown
InProgress
Failed
Succeeded
CompletedWithWarnings

PatchServiceUsed

Specifies the patch service used for the operation.

Value Description
Unknown
WU
WU_WSUS
YUM
APT
Zypper

VMGuestPatchClassification_Linux

The update classifications to select when installing patches for Linux.

Value Description
Critical
Security
Other

VMGuestPatchClassification_Windows

The update classifications to select when installing patches for Windows.

Value Description
Critical
Security
UpdateRollUp
FeaturePack
ServicePack
Definition
Tools
Updates

VMGuestPatchRebootSetting

Defines when it is acceptable to reboot a VM during a software update operation.

Value Description
IfRequired
Never
Always

VMGuestPatchRebootStatus

The reboot state of the VM following completion of the operation.

Value Description
Unknown
NotNeeded
Required
Started
Failed
Completed

WindowsParameters

Input for InstallPatches on a Windows VM, as directly received by the API

Name Type Description
classificationsToInclude

VMGuestPatchClassification_Windows[]

The update classifications to select when installing patches for Windows.

excludeKbsRequiringReboot

boolean

Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true.

kbNumbersToExclude

string[]

Kbs to exclude in the patch operation

kbNumbersToInclude

string[]

Kbs to include in the patch operation

maxPatchPublishDate

string (date-time)

This is used to install patches that were published on or before this given max published date.