Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Bicep resource definition
The hostPools/sessionHostManagements resource type can be deployed with operations that target:
- Resource groups - See resource group deployment commands
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.DesktopVirtualization/hostPools/sessionHostManagements resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.DesktopVirtualization/hostPools/sessionHostManagements@2026-01-01-preview' = {
parent: resourceSymbolicName
name: 'default'
properties: {
failedSessionHostCleanupPolicy: 'string'
provisioning: {
canaryPolicy: 'string'
instanceCount: int
setDrainMode: bool
}
scheduledDateTimeZone: 'string'
update: {
deleteOriginalVm: bool
logOffDelayMinutes: int
logOffMessage: 'string'
maxVmsRemoved: int
}
}
}
Property Values
Microsoft.DesktopVirtualization/hostPools/sessionHostManagements
| Name | Description | Value |
|---|---|---|
| name | The resource name | 'default' (required) |
| parent | In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource. For more information, see Child resource outside parent resource. |
Symbolic name for resource of type: hostPools |
| properties | Detailed properties for SessionHostManagement | SessionHostManagementProperties (required) |
HostPoolUpdateConfigurationProperties
| Name | Description | Value |
|---|---|---|
| deleteOriginalVm | Whether not to save original disk. False by default. | bool |
| logOffDelayMinutes | Grace period before logging off users in minutes. | int (required) |
| logOffMessage | Log off message sent to user for logoff. Default value is an empty string. | string Constraints: Max length = 260 |
| maxVmsRemoved | The maximum number of virtual machines to be removed during hostpool update. | int Constraints: Min value = 1 (required) |
SessionHostManagementProperties
| Name | Description | Value |
|---|---|---|
| failedSessionHostCleanupPolicy | The policy that should be applied when the Session Host provisioning operation fails. | 'KeepAll' 'KeepNone' 'KeepOne' |
| provisioning | Parameters that apply when session hosts are provisioned. | SessionHostProvisioningConfigurationProperties |
| scheduledDateTimeZone | Time zone for sessionHostManagement operations as defined in /dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is true. | string (required) |
| update | Parameters for a hostpool update. | HostPoolUpdateConfigurationProperties (required) |
SessionHostProvisioningConfigurationProperties
| Name | Description | Value |
|---|---|---|
| canaryPolicy | Policy on whether a Canary VM(a single VM to validate the configuration) should be provisioned during a session host provisioning operation. | 'Always' 'Auto' 'Never' |
| instanceCount | The number of session hosts to exist in the Host Pool. | int Constraints: Min value = 1 |
| setDrainMode | Whether the session host should be set in drain mode following provisioning. | bool |
ARM template resource definition
The hostPools/sessionHostManagements resource type can be deployed with operations that target:
- Resource groups - See resource group deployment commands
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.DesktopVirtualization/hostPools/sessionHostManagements resource, add the following JSON to your template.
{
"type": "Microsoft.DesktopVirtualization/hostPools/sessionHostManagements",
"apiVersion": "2026-01-01-preview",
"name": "string",
"properties": {
"failedSessionHostCleanupPolicy": "string",
"provisioning": {
"canaryPolicy": "string",
"instanceCount": "int",
"setDrainMode": "bool"
},
"scheduledDateTimeZone": "string",
"update": {
"deleteOriginalVm": "bool",
"logOffDelayMinutes": "int",
"logOffMessage": "string",
"maxVmsRemoved": "int"
}
}
}
Property Values
Microsoft.DesktopVirtualization/hostPools/sessionHostManagements
| Name | Description | Value |
|---|---|---|
| apiVersion | The api version | '2026-01-01-preview' |
| name | The resource name | 'default' (required) |
| properties | Detailed properties for SessionHostManagement | SessionHostManagementProperties (required) |
| type | The resource type | 'Microsoft.DesktopVirtualization/hostPools/sessionHostManagements' |
HostPoolUpdateConfigurationProperties
| Name | Description | Value |
|---|---|---|
| deleteOriginalVm | Whether not to save original disk. False by default. | bool |
| logOffDelayMinutes | Grace period before logging off users in minutes. | int (required) |
| logOffMessage | Log off message sent to user for logoff. Default value is an empty string. | string Constraints: Max length = 260 |
| maxVmsRemoved | The maximum number of virtual machines to be removed during hostpool update. | int Constraints: Min value = 1 (required) |
SessionHostManagementProperties
| Name | Description | Value |
|---|---|---|
| failedSessionHostCleanupPolicy | The policy that should be applied when the Session Host provisioning operation fails. | 'KeepAll' 'KeepNone' 'KeepOne' |
| provisioning | Parameters that apply when session hosts are provisioned. | SessionHostProvisioningConfigurationProperties |
| scheduledDateTimeZone | Time zone for sessionHostManagement operations as defined in /dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is true. | string (required) |
| update | Parameters for a hostpool update. | HostPoolUpdateConfigurationProperties (required) |
SessionHostProvisioningConfigurationProperties
| Name | Description | Value |
|---|---|---|
| canaryPolicy | Policy on whether a Canary VM(a single VM to validate the configuration) should be provisioned during a session host provisioning operation. | 'Always' 'Auto' 'Never' |
| instanceCount | The number of session hosts to exist in the Host Pool. | int Constraints: Min value = 1 |
| setDrainMode | Whether the session host should be set in drain mode following provisioning. | bool |
Usage Examples
Terraform (AzAPI provider) resource definition
The hostPools/sessionHostManagements resource type can be deployed with operations that target:
- Resource groups
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.DesktopVirtualization/hostPools/sessionHostManagements resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DesktopVirtualization/hostPools/sessionHostManagements@2026-01-01-preview"
name = "string"
parent_id = "string"
body = {
properties = {
failedSessionHostCleanupPolicy = "string"
provisioning = {
canaryPolicy = "string"
instanceCount = int
setDrainMode = bool
}
scheduledDateTimeZone = "string"
update = {
deleteOriginalVm = bool
logOffDelayMinutes = int
logOffMessage = "string"
maxVmsRemoved = int
}
}
}
}
Property Values
Microsoft.DesktopVirtualization/hostPools/sessionHostManagements
| Name | Description | Value |
|---|---|---|
| name | The resource name | 'default' (required) |
| parent_id | The ID of the resource that is the parent for this resource. | ID for resource of type: hostPools |
| properties | Detailed properties for SessionHostManagement | SessionHostManagementProperties (required) |
| type | The resource type | "Microsoft.DesktopVirtualization/hostPools/sessionHostManagements@2026-01-01-preview" |
HostPoolUpdateConfigurationProperties
| Name | Description | Value |
|---|---|---|
| deleteOriginalVm | Whether not to save original disk. False by default. | bool |
| logOffDelayMinutes | Grace period before logging off users in minutes. | int (required) |
| logOffMessage | Log off message sent to user for logoff. Default value is an empty string. | string Constraints: Max length = 260 |
| maxVmsRemoved | The maximum number of virtual machines to be removed during hostpool update. | int Constraints: Min value = 1 (required) |
SessionHostManagementProperties
| Name | Description | Value |
|---|---|---|
| failedSessionHostCleanupPolicy | The policy that should be applied when the Session Host provisioning operation fails. | 'KeepAll' 'KeepNone' 'KeepOne' |
| provisioning | Parameters that apply when session hosts are provisioned. | SessionHostProvisioningConfigurationProperties |
| scheduledDateTimeZone | Time zone for sessionHostManagement operations as defined in /dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is true. | string (required) |
| update | Parameters for a hostpool update. | HostPoolUpdateConfigurationProperties (required) |
SessionHostProvisioningConfigurationProperties
| Name | Description | Value |
|---|---|---|
| canaryPolicy | Policy on whether a Canary VM(a single VM to validate the configuration) should be provisioned during a session host provisioning operation. | 'Always' 'Auto' 'Never' |
| instanceCount | The number of session hosts to exist in the Host Pool. | int Constraints: Min value = 1 |
| setDrainMode | Whether the session host should be set in drain mode following provisioning. | bool |