Azure Bastion

Session Timeout Concepts

Azure Bastion provides secure RDP and SSH access to virtual machines without exposing them to the public internet. Session timeouts help protect resources by automatically terminating idle connections.

Default Timeout Settings

Connection TypeIdle TimeoutMaximum Session Length
RDP30 minutes8 hours
SSH20 minutes8 hours
WebSocket (proxy)15 minutes4 hours

These values can be overridden by configuring sessionTimeout and idleTimeout in the Azure Bastion resource.

Configuring Custom Timeouts

Use an ARM template or Azure CLI to set custom timeout values.

az network bastion create \
  --resource-group myResourceGroup \
  --name myBastion \
  --public-ip-address myBastionIP \
  --sku Standard \
  --session-timeout 4h \
  --idle-timeout 45m

Best Practices

Related Articles