active_sessions
Creates, updates, deletes, gets or lists an active_sessions resource.
Overview
| Name | active_sessions |
| Type | Resource |
| Id | azure.network.active_sessions |
Fields
The following fields are returned by SELECT queries:
- get_active_sessions
| Name | Datatype | Description |
|---|---|---|
protocol | string | The protocol used to connect to the target. Known values are: "SSH" and "RDP". (SSH, RDP) |
resourceType | string | The type of the resource. |
sessionDurationInMins | number | Duration in mins the session has been active. |
sessionId | string | A unique id for the session. |
startTime | object | The time when the session started. |
targetHostName | string | The host name of the target. |
targetIpAddress | string | The IP Address of the target. |
targetResourceGroup | string | The resource group of the target. |
targetResourceId | string | The resource id of the target. |
targetSubscriptionId | string | The subscription id for the target virtual machine. |
userName | string | The user name who is active on this session. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_active_sessions | select | resource_group_name, bastion_host_name, subscription_id | Returns the list of currently active sessions on the Bastion. |
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.
| Name | Datatype | Description |
|---|---|---|
bastion_host_name | string | The name of the Bastion Host. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get_active_sessions
Returns the list of currently active sessions on the Bastion.
SELECT
protocol,
resourceType,
sessionDurationInMins,
sessionId,
startTime,
targetHostName,
targetIpAddress,
targetResourceGroup,
targetResourceId,
targetSubscriptionId,
userName
FROM azure.network.active_sessions
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND bastion_host_name = '{{ bastion_host_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;