Virtual Machines - Assess Patches
Assess patches on the VM.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches?api-version=2025-04-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
subscription
|
path | True |
string minLength: 1 |
The ID of the target subscription. |
|
vm
|
path | True |
string |
The name of the virtual machine. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Azure operation completed successfully. |
|
| 202 Accepted |
Resource operation accepted. Headers
|
|
| Other Status Codes |
An unexpected error response. |
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
Assess patch state of a virtual machine.
Sample request
Sample response
{
"status": "Succeeded",
"assessmentActivityId": "68f8b292-dfc2-4646-9781-33cc88631968",
"rebootPending": true,
"criticalAndSecurityPatchCount": 1,
"otherPatchCount": 2,
"startDateTime": "2020-04-24T21:02:04.2556154Z",
"availablePatches": [
{
"patchId": "35428702-5784-4ba4-a6e0-5222258b5411",
"name": "Definition Update for Windows Defender Antivirus - KB2267602 (Definition 1.279.1373.0)",
"version": "",
"kbId": "2267602",
"classifications": [
"Definition Updates"
],
"rebootBehavior": "NeverReboots",
"activityId": "68f8b292-dfc2-4646-9781-33cc88631968",
"publishedDate": "2018-11-07T00:00:00Z",
"lastModifiedDateTime": "2020-04-24T21:18:45.2830263Z",
"assessmentState": "Available"
},
{
"patchId": "39f9cdd1-795c-4d0e-8c0a-73ab3f31746d",
"name": "Windows Malicious Software Removal Tool x64 - October 2018 (KB890830)",
"version": "",
"kbId": "890830",
"classifications": [
"Update Rollups"
],
"rebootBehavior": "CanRequestReboot",
"activityId": "68f8b292-dfc2-4646-9781-33cc88631968",
"publishedDate": "2018-11-07T00:00:00Z",
"lastModifiedDateTime": "2020-04-24T21:18:45.2830263Z",
"assessmentState": "Available"
}
],
"error": null
}
Location: https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/westus/operations/{operationId}&monitor=true&api-version=2025-04-01
Definitions
| Name | Description |
|---|---|
|
Api |
Api error. |
|
Api |
Api error base. |
|
Cloud |
An error response from the Compute service. |
|
Inner |
Inner error details. |
|
Patch |
Describes the availability of a given patch. |
|
Patch |
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." |
|
Virtual |
Describes the properties of an AssessPatches result. |
|
Virtual |
Describes the properties of a Virtual Machine software patch. |
|
VMGuest |
Describes the reboot requirements of the patch. |
ApiError
Api error.
| Name | Type | Description |
|---|---|---|
| code |
string |
The error code. |
| details |
The Api error details |
|
| innererror |
The Api inner error |
|
| message |
string |
The error message. |
| target |
string |
The target of the particular error. |
ApiErrorBase
Api error base.
| Name | Type | Description |
|---|---|---|
| code |
string |
The error code. |
| message |
string |
The error message. |
| target |
string |
The target of the particular error. |
CloudError
An error response from the Compute service.
| Name | Type | Description |
|---|---|---|
| error |
Api error. |
InnerError
Inner error details.
| Name | Type | Description |
|---|---|---|
| errordetail |
string |
The internal error message or exception dump. |
| exceptiontype |
string |
The exception type. |
PatchAssessmentState
Describes the availability of a given patch.
| Value | Description |
|---|---|
| Unknown | |
| Available |
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 |
VirtualMachineAssessPatchesResult
Describes the properties of an AssessPatches result.
| Name | Type | Description |
|---|---|---|
| assessmentActivityId |
string |
The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. |
| availablePatches |
The list of patches that have been detected as available for installation. |
|
| criticalAndSecurityPatchCount |
integer (int32) |
The number of critical or security patches that have been detected as available and not yet installed. |
| error |
The errors that were encountered during execution of the operation. The details array contains the list of them. |
|
| otherPatchCount |
integer (int32) |
The number of all available patches excluding critical and security. |
| rebootPending |
boolean |
The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. |
| startDateTime |
string (date-time) |
The UTC timestamp when the operation began. |
| status |
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." |
VirtualMachineSoftwarePatchProperties
Describes the properties of a Virtual Machine software patch.
| Name | Type | Description |
|---|---|---|
| activityId |
string |
The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. |
| assessmentState |
Describes the availability of a given patch. |
|
| classifications |
string[] |
The classification(s) of the patch as provided by the patch publisher. |
| kbId |
string |
The KBID of the patch. Only applies to Windows patches. |
| lastModifiedDateTime |
string (date-time) |
The UTC timestamp of the last update to this patch record. |
| name |
string |
The friendly name of the patch. |
| patchId |
string |
A unique identifier for the patch. |
| publishedDate |
string (date-time) |
The UTC timestamp when the repository published this patch. |
| rebootBehavior |
Describes the reboot requirements of the patch. |
|
| version |
string |
The version number of the patch. This property applies only to Linux patches. |
VMGuestPatchRebootBehavior
Describes the reboot requirements of the patch.
| Value | Description |
|---|---|
| Unknown | |
| NeverReboots | |
| AlwaysRequiresReboot | |
| CanRequestReboot |