Session Hosts - Delete

Remove a SessionHost.

DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}?api-version=2022-02-10-preview
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}?api-version=2022-02-10-preview&force={force}

URI Parameters

Name In Required Type Description
hostPoolName
path True

string

The name of the host pool within the specified resource group

resourceGroupName
path True

string

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

sessionHostName
path True

string

The name of the session host within the specified host pool

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

force
query

boolean

Force flag to force sessionHost deletion even when userSession exists.

Responses

Name Type Description
200 OK

Successfully removed session host.

204 No Content

Session host does not exist.

Other Status Codes

CloudError

Automation error response describing why the operation failed.

Examples

SessionHost_Delete

Sample request

DELETE https://management.azure.com/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1/sessionHosts/sessionHost1.microsoft.com?api-version=2022-02-10-preview&force=True

Sample response

Definitions

Name Description
CloudError

Cloud error object.

CloudErrorProperties

Cloud error object properties.

CloudError

Cloud error object.

Name Type Description
error

CloudErrorProperties

Cloud error object properties.

CloudErrorProperties

Cloud error object properties.

Name Type Description
code

string

Error code

message

string

Error message indicating why the operation failed.