The Azure storage driver integrates with Azure Blob Storage, Microsoft’s object storage solution for the cloud. It provides highly available, secure, and scalable storage with global distribution capabilities.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/directus/directus/llms.txt
Use this file to discover all available pages before exploring further.
Installation
The Azure driver is included by default with Directus via the@directus/storage-driver-azure package, which uses the Azure Storage SDK.
Configuration
Configure Azure storage using environment variables:Configuration Options
The Azure Blob Storage container name where files will be stored.
The Azure Storage account name.
The Azure Storage account access key.
Optional path prefix for all files within the container.
Custom endpoint URL. Default:
https://{accountName}.blob.core.windows.net.Enable TUS resumable uploads. Default:
false.Chunk size for resumable uploads in bytes. Maximum:
104857600 (100 MiB). Only used when TUS is enabled.Examples
Basic Configuration
With Root Path
Custom Endpoint
With Resumable Uploads
Features
Resumable Uploads
The Azure driver supports TUS resumable uploads using Azure Append Blobs from/packages/storage-driver-azure/src/index.ts:23-151:
- Uses Azure Append Blob for chunked uploads
- Maximum chunk size: 100 MiB (enforced)
- Resume interrupted uploads
- Automatic chunk accumulation
Blob Types
The driver uses different blob types for different operations:- Block Blobs - Standard uploads and file storage
- Append Blobs - Resumable TUS uploads
Copy Operations
Azure native copy operations from/packages/storage-driver-azure/src/index.ts:93-99:
- Server-side copy without data transfer
- Asynchronous operation with polling
- No bandwidth usage for copying
Implementation Details
The Azure driver (DriverAzure class) from /packages/storage-driver-azure/src/index.ts:23-151:
- Maximum chunk size validation: 100 MiB from
/packages/storage-driver-azure/src/index.ts:9 - Uses
StorageSharedKeyCredentialfor authentication - Supports custom endpoints for government and sovereign clouds
- Implements efficient streaming for large files
Best Practices
Access Keys
Securely store your access keys:Container Configuration
Create the container before using it:Access Tiers
Configure blob access tier for cost optimization:- Hot - Frequently accessed files
- Cool - Infrequently accessed files (30+ days)
- Archive - Rarely accessed files (180+ days)
CORS Configuration
If accessing files directly from browsers:Lifecycle Management
Configure lifecycle policies to automatically transition or delete blobs:Authentication Alternatives
Consider using Azure Active Directory (Managed Identity) for enhanced security:- Enable Managed Identity on your Azure App Service
- Grant “Storage Blob Data Contributor” role to the managed identity
- Use
DefaultAzureCredentialin custom implementations
Performance Optimization
- Use Azure CDN for frequently accessed files
- Enable Azure Storage Analytics for monitoring
- Consider Azure Premium Storage for high IOPS requirements
- Use zone-redundant storage (ZRS) or geo-redundant storage (GRS) based on availability needs
Networking
Configure network rules for enhanced security:Troubleshooting
Authentication Errors
- Verify account name and key are correct
- Check if the storage account exists
- Ensure the account key has not been rotated
- Verify network access rules
Container Not Found
Ensure the container exists:Chunk Size Errors
If you see “Invalid chunkSize provided” error:- Maximum chunk size is 100 MiB (104857600 bytes)
- Reduce
STORAGE_AZURE_TUS__CHUNK_SIZEvalue
Connection Issues
- Verify endpoint URL is correct
- Check firewall and network security group rules
- Ensure the storage account is not behind a VNet without proper access
- Test connectivity:
curl https://{accountName}.blob.core.windows.net