Skip to main content

active_sessions

Creates, updates, deletes, gets or lists an active_sessions resource.

Overview

Nameactive_sessions
TypeResource
Idazure.network.active_sessions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
protocolstringThe protocol used to connect to the target. Known values are: "SSH" and "RDP". (SSH, RDP)
resourceTypestringThe type of the resource.
sessionDurationInMinsnumberDuration in mins the session has been active.
sessionIdstringA unique id for the session.
startTimeobjectThe time when the session started.
targetHostNamestringThe host name of the target.
targetIpAddressstringThe IP Address of the target.
targetResourceGroupstringThe resource group of the target.
targetResourceIdstringThe resource id of the target.
targetSubscriptionIdstringThe subscription id for the target virtual machine.
userNamestringThe user name who is active on this session.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_active_sessionsselectresource_group_name, bastion_host_name, subscription_idReturns 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.

NameDatatypeDescription
bastion_host_namestringThe name of the Bastion Host. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

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
;