Blog Post

Azure Network Security Blog
5 MIN READ

A deep dive into Azure Bastion session recording

juquint's avatar
juquint
Icon for Microsoft rankMicrosoft
Jun 11, 2026

If you’ve worked with Azure Bastion’s Premium SKU, you’ve likely encountered one of its most powerful security features: graphical session recording. Capturing RDP and SSH sessions end to end strengthens compliance, supports forensic investigations, and improves operational accountability. How you configure session recording can make a significant difference. It determines whether you must manage manual tokens and expiry settings or benefit from a low-maintenance experience.

With the recently announced Public Preview: Managed Identity support for graphical session recording, managing Bastion authentication credentials to store session recordings to a designated storage account is simpler and reduces manual work.

In this blog, we’ll explain the Azure Bastion session recording feature, show how to set it up, compare SAS URL and Managed Identity options for storage authentication, and outline why Managed Identity is a great choice for production and enterprise environments.

What Is Azure Bastion session recording?

Azure Bastion is Microsoft’s fully managed, browser-based RDP/SSH gateway that removes the need for a public IP on your VMs. With the Premium SKU, you get access to session recording, which records graphical activity for every RDP and SSH session and uploads it as a browser playable video within the Bastion resource → Session recordings blade.

This gives security teams:

  • An audit trail of admin and user interactions
  • Forensic evidence for incident response
  • Visibility into privileged access across your environment

Prerequisites

Before you can enable session recording, you need:

 

Requirement

Detail

Azure Bastion SKU

Premium (Developer, Basic, and Standard do not support this feature)

Storage Account

General Purpose v2, same Azure region as Bastion

Permissions

Owner or Contributor on the Bastion resource and Blob Data Reader permission on the storage account for users to access the recordings

The two configuration options

When you enable session recording, Azure Bastion needs a way to authenticate to your Storage Account to upload the recorded sessions. There are two options:

  • SAS URL
  • Managed Identity

Let’s look at how to set up each authentication option.

Option 1: SAS URL

How it works

A Shared Access Signature (SAS) is a URI that grants restricted, time-limited access to Azure Storage resources. When using this option for session recording:

  1. You navigate to your Storage Account and generate a SAS URL token scoped to your container with at minimum Read, Create, Write, and List permissions.
  2. You paste the resulting SAS URL into the Bastion session recording blade.
  3. Bastion uses that URL to authenticate and write recordings to a storage container for every session.

Prerequisites

  1. If you have not configured a storage account container for session recordings, visit Configure storage account container.
  2. Ensure you have Session recording and SAS URL selected in Azure Bastion configuration settings.

 

Setup steps

  1. Go to your Storage Account. In the left pane, expand Settings, then select Resource sharing (CORS).
  2. Create a new policy under Blob service with the following values and save your changes at the top of the page.

 

  1. Next go to your Storage Account → Data Storage → Containers → Choose your container → Select Shared access tokens under Settings
  2. Under permissions drop down, select Read, Create, Write, and List. This is the minimum set of privileges required for session recording.
  3. Define a start and expiry date and select generate the SAS token and URL.

 

 

 

  1. Copy the Blob service SAS URL provided.
  2. In your Bastion resource → Session recording → paste the SAS URL and select Upload.

 

  1. New Azure Bastion sessions will now be recorded and available with the option for immediate playback.

 

The challenges of using SAS URLs at scale

🔴 Token expiry overhead: SAS tokens expire after a set period. Once a token expires, Bastion can no longer write recordings, which can silently interrupt your audit trail until someone detects the issue and generates a new token.

🔴 Token access risk: If a SAS URL is accidentally logged or shared, it grants write access to your storage account for anyone who has access to it.

🔴 No Entra ID identity: Because SAS tokens provide preauthorized access for a limited time, they bypass Entra RBAC capabilities entirely. This means they don’t benefit from Conditional Access policies restriction capabilities.

🔴 Manual rotation: Unlike secrets stored in Key Vault with automated rotation, SAS tokens require a human or a custom automation pipeline to regenerate and update the Bastion configuration on a regular cadence.

Option 2: Managed Identity

How it works

Azure Managed Identity is a feature of Microsoft Entra ID that provides Azure services with an automatically managed identity—no passwords, secrets, or tokens required. When Bastion is configured with a Managed Identity for session recording:

  • Bastion’s system-assigned (or user-assigned) managed identity authenticates to the Storage Account via Microsoft Entra ID tokens issued by the Entra ID platform.
  • RBAC controls what that identity can do. Specifically, it requires the Storage Blob Data Contributor role on the storage account.
  • Token issuance, refresh, and lifecycle are all handled automatically by Azure.

Setup Steps

  1. Go to your Storage Account. In the left pane, expand Settings, then select Resource sharing (CORS).
  2. Create a new policy under Blob service with the following values and save your changes at the top of the page.

 

  1. Next navigate to Identity (Preview). In our example, we are using a System Assigned Managed Identity, so we toggle Status to On to enable the Managed Identity to be used by Bastion for session recordings. An object (principal) ID will be generated, which is the unique identifier of the managed identity resources that is registered with Microsoft Entra ID for authentication purposes.

 

  1. Ensure you have Session recording and either System Assigned or User Assigned Managed Identity is selected in Azure Bastion configuration settings.

     

  1. Select the container you would like to store session recordings to and validate Blob Container URI is correctly noted in the configuration and click Apply to perform the configuration changes on the Bastion host.

 

 

  1. Now we need to allow RBAC permissions for the Managed Identity to store session recordings in our configured Storage Account and Container. Under Permissions select Azure role assignments.

 

  1. Select Add role assignment (Preview) and a new blade will appear. Here, will choose our scope which is Storage, we select our subscription, and target our Storage Account under Resource category, and for Role we will need to choose Storage Blob Data Contributor for the role assignment. Proceed to click Save to see our new role assignment listed.

 

  1. The setup and configuration is complete and Azure Bastion will now use the configured system-assigned managed identity to store session recordings on our Storage Container. Recordings can be found after a session in the Session recordings option under Settings.

Benefits of a Managed Identity

🔴 No credentials to manage: No need to worry about credentials leaking or needing rotation.

🔴 No risks of silent failures: SAS tokens can expire and stop recordings without warning. Managed Identity handles tokens automatically, so recording continues without issues.

🔴 Better security visibility: It’s part of Entra ID, so you can see it in access reviews and control it with proper permissions.

🔴 Compliance improvements: It uses a real identity that can be tracked and audited, which aligns better with security and compliance requirements.

Conclusion

Azure Bastion session recording is essential for organizations that need to monitor privileged access. Using Managed Identity for authentication helps protect against credential leaks and requires no ongoing maintenance after setup, compared to the SAS URL configuration option.

References

Updated Jun 11, 2026
Version 5.0
No CommentsBe the first to comment