Share via


Initiate Session Host Update - Post

Initiates a hostpool update or schedule an update for the future.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/initiateSessionHostUpdate?api-version=2025-03-01-preview

URI Parameters

Name In Required Type Description
hostPoolName
path True

string

minLength: 1
maxLength: 255
pattern: ^[A-Za-z0-9@.\-_ ]*$

The name of the host pool within the specified resource group

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Type Description
scheduledDateTime

string (date-time)

The timestamp that the update validation is scheduled for. If none is provided, the update will be executed immediately

scheduledDateTimeZone

string

The timeZone as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid.

update

HostPoolUpdateConfigurationPatchProperties

settings for management information for the hostpool update operation. If none is provided the update will use the settings saved in the sessionHostManagement object.

Responses

Name Type Description
204 No Content

Successfully initiated hostpool update.

Other Status Codes

ErrorResponse

Automation error response describing why the operation failed.

Examples

HostPools_Update_Post

Sample request

POST https://management.azure.com/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHostManagements/default/initiateSessionHostUpdate?api-version=2025-03-01-preview

{
  "scheduledDateTime": "2008-09-22T14:01:54.9571247Z",
  "scheduledDateTimeZone": "Alaskan Standard Time",
  "update": {
    "deleteOriginalVm": true,
    "maxVmsRemoved": 4,
    "logOffDelayMinutes": 10,
    "logOffMessage": "logging off for hostpool update"
  }
}

Sample response

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

HostPoolUpdateConfigurationPatchProperties

The configurations of a hostpool update.

UpdateSessionHostsRequestBody

Object containing the definition for properties to be used for a sessionHostUpdate operation.

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.

HostPoolUpdateConfigurationPatchProperties

The configurations of a hostpool update.

Name Type Description
deleteOriginalVm

boolean

Whether not to save original disk. False by default.

logOffDelayMinutes

integer (int32)

Grace period before logging off users in minutes.

logOffMessage

string

maxLength: 260

Log off message sent to user for logoff.

maxVmsRemoved

integer (int32)

minimum: 1

The maximum number of virtual machines to be removed during hostpool update.

UpdateSessionHostsRequestBody

Object containing the definition for properties to be used for a sessionHostUpdate operation.

Name Type Description
scheduledDateTime

string (date-time)

The timestamp that the update validation is scheduled for. If none is provided, the update will be executed immediately

scheduledDateTimeZone

string

The timeZone as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid.

update

HostPoolUpdateConfigurationPatchProperties

settings for management information for the hostpool update operation. If none is provided the update will use the settings saved in the sessionHostManagement object.