Skip to main content

session_hosts

Creates, updates, deletes, gets or lists a session_hosts resource.

Overview

Namesession_hosts
TypeResource
Idazure.desktop_virtualization.session_hosts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
namestringThe name of the resource.
agentVersionstringVersion of agent on SessionHost.
allowNewSessionbooleanAllow a new session.
assignedUserstringUser assigned to SessionHost.
friendlyNamestringFriendly name of SessionHost.
lastHeartBeatstring (date-time)Last heart beat from SessionHost.
lastUpdateTimestring (date-time)The timestamp of the last update.
objectIdstringObjectId of SessionHost. (internal use).
osVersionstringThe version of the OS on the session host.
resourceIdstringResource Id of SessionHost's underlying virtual machine.
sessionHostHealthCheckResultsarrayList of SessionHostHealthCheckReports.
sessionsintegerNumber of sessions on SessionHost.
statusstringStatus for a SessionHost. Known values are: "Available", "Unavailable", "Shutdown", "Disconnected", "Upgrading", "UpgradeFailed", "NoHeartbeat", "NotJoinedToDomain", "DomainTrustRelationshipLost", "SxSStackListenerNotReady", "FSLogixNotHealthy", and "NeedsAssistance".
statusTimestampstring (date-time)The timestamp of the status.
sxSStackVersionstringThe version of the side by side stack on the session host.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
updateErrorMessagestringThe error message.
updateStatestringUpdate state of a SessionHost. Known values are: "Initial", "Pending", "Started", "Succeeded", and "Failed".
virtualMachineIdstringVirtual Machine Id of SessionHost's underlying virtual machine.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, host_pool_name, session_host_name, subscription_idGet a session host.
listselectresource_group_name, host_pool_name, subscription_idpageSize, isDescending, initialSkipList sessionHosts.
updateupdateresource_group_name, host_pool_name, session_host_name, subscription_idforceUpdate a session host.
deletedeleteresource_group_name, host_pool_name, session_host_name, subscription_idforceRemove a SessionHost.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
host_pool_namestringThe name of the host pool within the specified resource group. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
session_host_namestringThe name of the session host within the specified host pool. Required.
subscription_idstring
forcebooleanForce flag to force sessionHost deletion even when userSession exists. Default value is None.
initialSkipintegerInitial number of items to skip. Default value is None.
isDescendingbooleanIndicates whether the collection is descending. Default value is None.
pageSizeintegerNumber of items per page. Default value is None.

SELECT examples

Get a session host.

SELECT
id,
name,
agentVersion,
allowNewSession,
assignedUser,
friendlyName,
lastHeartBeat,
lastUpdateTime,
objectId,
osVersion,
resourceId,
sessionHostHealthCheckResults,
sessions,
status,
statusTimestamp,
sxSStackVersion,
systemData,
type,
updateErrorMessage,
updateState,
virtualMachineId
FROM azure.desktop_virtualization.session_hosts
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND host_pool_name = '{{ host_pool_name }}' -- required
AND session_host_name = '{{ session_host_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

UPDATE examples

Update a session host.

UPDATE azure.desktop_virtualization.session_hosts
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND host_pool_name = '{{ host_pool_name }}' --required
AND session_host_name = '{{ session_host_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND force = {{ force}}
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Remove a SessionHost.

DELETE FROM azure.desktop_virtualization.session_hosts
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND host_pool_name = '{{ host_pool_name }}' --required
AND session_host_name = '{{ session_host_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND force = '{{ force }}'
;