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:

Success. The operation returns a list of active sessions on the Bastion.

NameDatatypeDescription
protocolstringThe protocol used to connect to the target.
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
getselectresourceGroupName, bastionHostName, subscriptionIdReturns 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
bastionHostNamestringThe name of the Bastion Host.
resourceGroupNamestringThe name of the resource group.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.

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 resourceGroupName = '{{ resourceGroupName }}' -- required
AND bastionHostName = '{{ bastionHostName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;