Understand Shared Access Signature (SAS) tokens and their security benefits
Create different types of SAS tokens (Account, Service, and User Delegation)
Configure SAS permissions and expiration times for secure access control
Test SAS token functionality from different clients and scenarios
Implement time-based access control using SAS token expiration
Troubleshoot SAS token issues and understand security implications
Scenario: Your organization needs to provide temporary, secure access to Azure Storage resources for external partners and applications without sharing storage account keys. Youโll create and manage SAS tokens with different permission levels and expiration times.
Lab Environment Ready!
Username:
Password:
MFA Verification Code:
------
30s remaining
No verification code available. Click 'Refresh Code'.
๐ Please sign in to launch lab.
Lab Environment Ready!
Username:
Password:
MFA Verification Code:
------
30s remaining
No verification code available. Click 'Refresh Code'.
๐๏ธ Pre-Provisioned Environment
The following Azure resources have been pre-deployed in your environment:
Resource Overview
Resource Type
Resource Name
Configuration
Purpose
Resource Group
SASTokens-Lab-RG
Contains all lab resources
Logical container
Storage Account
sastokenlab[unique]
General Purpose v2
Primary storage resource
Blob Container
documents
Private access level
Document storage
Blob Container
images
Private access level
Image storage
Blob Container
public-data
Private access level
Publicly accessible data
Test VM
ClientVM
Windows Server 2019
SAS token testing client
Sample Files
Various
Pre-uploaded content
Test data for SAS operations
Storage Structure
sastokenlab[unique] (Storage Account)
โโโ documents (Container)
โ โโโ report.pdf
โ โโโ contract.docx
โ โโโ presentation.pptx
โโโ images (Container)
โ โโโ logo.png
โ โโโ banner.jpg
โ โโโ profile.gif
โโโ public-data (Container)
โโโ readme.txt
โโโ changelog.md
โโโ license.txt
VM Details
VM
Private IP
Operating System
Purpose
ClientVM
10.0.1.4
Windows Server 2019
Test SAS token access scenarios
๐ Lab Exercises
Part 1: Explore Storage Account and Containers
Step 1: Navigate to Storage Account
Navigate to SASTokens-Lab-RG resource group
Click on the Storage Account (sastokenlab[unique])
In the left menu, click Containers
Explore the containers: documents, images, public-data
Step 2: View Container Contents
Click on documents container
Observe the files: report.pdf, contract.docx, presentation.pptx
Try to access a file directly:
Click on report.pdf
Click Generate SAS (weโll use this later)
For now, note that direct access requires authentication
Step 3: Test Unauthenticated Access
Copy the blob URL for report.pdf
Open a new incognito/private browser window
Paste the URL and try to access
Expected Result: โ Access should be denied (403 Forbidden)
Part 2: Create Account-Level SAS Token
Step 1: Generate Account SAS
In your storage account, go to Security + networking โ Shared access signature
Configure Account SAS settings:
Setting
Value
Purpose
Allowed services
โ Blob, โ File, โ Queue, โ Table
All services
Allowed resource types
โ Service, โ Container, โ Object
All resource types
Allowed permissions
โ Read, โ Write, โ Delete, โ List
Full permissions
Start time
Current time
Immediate access
Expiry time
+24 hours
Valid for 24 hours
Allowed IP addresses
Leave empty
No IP restrictions
Allowed protocols
HTTPS only
Secure transport
Click Generate SAS and connection string
Step 2: Copy SAS Token Information
Save the following information:
SAS token: Copy the full token string (starts with ?sv=)
Blob service SAS URL: Copy the complete URL
Connection string: Copy for programmatic access
Step 3: Test Account SAS Token
Manual URL test:
Take the report.pdf URL from earlier
Append the SAS token: https://sastokenlab[unique].blob.core.windows.net/documents/report.pdf[SAS-TOKEN]
Open in incognito browser window
Expected Result: โ File should download successfully
Part 3: Create Container-Level SAS Token
Step 1: Generate Container SAS
Navigate to Containers โ images
Click the โฆ menu โ Generate SAS
Configure Container SAS settings:
Setting
Value
Purpose
Permissions
โ Read, โ List
Read-only access
Start time
Current time
Immediate access
Expiry time
+2 hours
Short-term access
Allowed IP addresses
Leave empty
No IP restrictions
Allowed protocols
HTTPS only
Secure transport
Click Generate SAS token and URL
Step 2: Test Container SAS
Copy the Blob SAS URL
Test in incognito browser: Should show XML listing of container contents