Microsoft.DesktopVirtualization (preview:2025-04-01)

2025/10/24 • 1 updated methods

SessionHostManagements_Update (updated)
Description Update a SessionHostManagement.
Reference Link ¶

⚶ Changes

{
  "#id": "SessionHostManagements_Update",
  "$parameters": {
    "sessionHostManagement": {
      "$properties": {
        "properties": [
          {
            "@added_8ad693ad6be3452a9b4be379416dfb04": {
              "#name": "provisioning",
              "Description": "Parameters that apply when session hosts are provisioned.",
              "Required": false,
              "Type": "object",
              "$properties": [
                {
                  "#name": "setDrainMode",
                  "Description": "Whether the session host should be set in drain mode following provisioning.",
                  "Required": false,
                  "Type": "boolean"
                },
                {
                  "#name": "instanceCount",
                  "Description": "The number of session hosts to exist in the Host Pool.",
                  "Format": "int32",
                  "Required": false,
                  "Type": "integer"
                },
                {
                  "#name": "canaryPolicy",
                  "Description": "Policy on whether a Canary VM(a single VM to validate the configuration) should be provisioned during a session host provisioning operation.",
                  "Enum": [
                    [
                      "Auto",
                      "Decided by service whether to provision Canary VM."
                    ],
                    [
                      "Never",
                      "Never provision Canary VM."
                    ],
                    [
                      "Always",
                      "Always provision Canary VM."
                    ]
                  ],
                  "Required": false,
                  "Type": "string"
                }
              ]
            }
          },
          {
            "@added_47bfff3d23924ed8bccd2f6bc6b597a2": {
              "#name": "failedSessionHostCleanupPolicy",
              "Description": "The policy that should be applied when the Session Host provisioning operation fails.",
              "Enum": [
                [
                  "KeepAll",
                  "Keep All."
                ],
                [
                  "KeepOne",
                  "Keep One."
                ],
                [
                  "KeepNone",
                  "Keep None."
                ]
              ],
              "Required": false,
              "Type": "string"
            }
          }
        ]
      }
    }
  }
}

⚼ Request

PATCH:  /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default
{
api-version: string ,
subscriptionId: string ,
resourceGroupName: string ,
hostPoolName: string ,
sessionHostManagement:
{
properties:
{
scheduledDateTimeZone: string ,
update:
{
deleteOriginalVm: boolean ,
maxVmsRemoved: integer ,
logOffDelayMinutes: integer ,
logOffMessage: string ,
}
,
provisioning:
{
setDrainMode: boolean ,
instanceCount: integer ,
canaryPolicy: enum ,
}
,
failedSessionHostCleanupPolicy: enum ,
}
,
}
,
}

⚐ Response (200)

{
properties:
{
scheduledDateTimeZone: string ,
update:
{
deleteOriginalVm: boolean ,
maxVmsRemoved: integer ,
logOffDelayMinutes: integer ,
logOffMessage: string ,
}
,
provisioning:
{
setDrainMode: boolean ,
instanceCount: integer ,
canaryPolicy: enum ,
}
,
failedSessionHostCleanupPolicy: enum ,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
additionalInfo:
[
{
type: string ,
info: object ,
}
,
]
,
}
,
}