Apply Updates - Create Or Update Or Cancel

Apply Updates to resource
Apply maintenance updates to resource

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}?api-version=2023-09-01-preview

URI Parameters

Name In Required Type Description
applyUpdateName
path True

string

ApplyUpdate name

providerName
path True

string

Resource provider name

resourceGroupName
path True

string

Resource group name

resourceName
path True

string

Resource identifier

resourceType
path True

string

Resource type

subscriptionId
path True

string

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True

string

Version of the API to be used with the client request.

Request Body

Name Type Description
properties.lastUpdateTime

string

Last Update time

properties.resourceId

string

The resourceId

properties.status

UpdateStatus

The status

Responses

Name Type Description
200 OK

ApplyUpdate

ApplyUpdate update request accepted

201 Created

ApplyUpdate

ApplyUpdate create request accepted

Other Status Codes

MaintenanceError

BadRequest

Examples

ApplyUpdates_CreateOrUpdateOnly_NoCancellation
ApplyUpdates_CreateOrUpdateOrCancel

ApplyUpdates_CreateOrUpdateOnly_NoCancellation

Sample request

PUT https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/applyUpdates/20230901121200?api-version=2023-09-01-preview

{}

Sample response

{
  "id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/applyUpdates/e9b9685d-78e4-44c4-a81c-64a14f9b87b6",
  "name": "e9b9685d-78e4-44c4-a81c-64a14f9b87b6",
  "type": "Microsoft.Maintenance/applyUpdates",
  "properties": {
    "resourceId": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1",
    "status": "Pending"
  }
}
{
  "id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1/providers/Microsoft.Maintenance/applyUpdates/e9b9685d-78e4-44c4-a81c-64a14f9b87b6",
  "name": "e9b9685d-78e4-44c4-a81c-64a14f9b87b6",
  "type": "Microsoft.Maintenance/applyUpdates",
  "properties": {
    "resourceId": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Compute/virtualMachineScaleSets/smdtest1",
    "status": "Pending"
  }
}

ApplyUpdates_CreateOrUpdateOrCancel

Sample request

PUT https://management.azure.com/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfig1/providers/Microsoft.Maintenance/applyUpdates/20230901121200?api-version=2023-09-01-preview

{
  "properties": {
    "status": "Cancel"
  }
}

Sample response

{
  "id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/microsoft.maintenance/maintenanceconfigurations/maintenanceconfig1/providers/microsoft.maintenance/applyupdates/20230901121200",
  "name": "maintenanceConfig1",
  "type": "Microsoft.Maintenance/applyUpdates",
  "properties": {
    "status": "Cancelled",
    "resourceId": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/microsoft.maintenance/maintenanceconfigurations/maintenanceconfig1"
  }
}
{
  "id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/microsoft.maintenance/maintenanceconfigurations/maintenanceconfig1/providers/microsoft.maintenance/applyupdates/20230901121200",
  "name": "maintenanceConfig1",
  "type": "Microsoft.Maintenance/applyUpdates",
  "properties": {
    "status": "Cancelled",
    "resourceId": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/microsoft.maintenance/maintenanceconfigurations/maintenanceconfig1"
  }
}

Definitions

Name Description
ApplyUpdate

Apply Update request

createdByType

The type of identity that created the resource.

ErrorDetails

An error response details received from the Azure Maintenance service.

MaintenanceError

An error response received from the Azure Maintenance service.

systemData

Metadata pertaining to creation and last modification of the resource.

UpdateStatus

The status

ApplyUpdate

Apply Update request

Name Type Description
id

string

Fully qualified identifier of the resource

name

string

Name of the resource

properties.lastUpdateTime

string

Last Update time

properties.resourceId

string

The resourceId

properties.status

UpdateStatus

The status

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type

string

Type of the resource

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

ErrorDetails

An error response details received from the Azure Maintenance service.

Name Type Description
code

string

Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.

message

string

Human-readable representation of the error.

MaintenanceError

An error response received from the Azure Maintenance service.

Name Type Description
error

ErrorDetails

Details of the error

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

UpdateStatus

The status

Name Type Description
Cancel

string

Cancel the schedule and stop creating PMR for resources part of it. Applicable to Maintenance Configuration resource type only.

Cancelled

string

Send the Cancelled response to the user if request came to cancel the schedule. Applicable to Maintenance Configuration resource type only.

Completed

string

All updates are successfully applied.

InProgress

string

Updates installation are in progress.

NoUpdatesPending

string

No updates are pending.

Pending

string

There are pending updates to be installed.

RetryLater

string

Updates installation failed and should be retried later.

RetryNow

string

Updates installation failed but are ready to retry again.