AzureBlobLoader fetches blobs from an Azure Blob Storage container and returns them as
Chunk objects containing
UTF-8 decoded content plus source metadata (source, account_url, container,
blob_name).
=== "pip"
```bash
pip install railtracks[azure-blob]
```
=== "uv"
```bash
uv add railtracks[azure-blob]
```
Authentication defaults to DefaultAzureCredential, which automatically resolves
credentials from the following sources (in order):
- Environment variables (
AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_CLIENT_SECRET) - Workload identity (Kubernetes)
- Managed identity (Azure-hosted compute)
- Azure CLI (
az login) - Azure PowerShell / Visual Studio / IntelliJ
Pass an explicit credential to override.
!!! tip "Prefer managed identity over connection strings" Managed identity is the recommended authentication method for Azure-hosted workloads — it requires no secrets and rotates automatically. Avoid embedding storage account keys or SAS tokens in source code; store them in Azure Key Vault or environment variables instead.
--8<-- "docs/scripts/storage_loaders.py:azure_basic"--8<-- "docs/scripts/storage_loaders.py:azure_prefix"--8<-- "docs/scripts/storage_loaders.py:azure_load_keys"--8<-- "docs/scripts/storage_loaders.py:azure_async"!!! note "Async is thread-backed"
aload() and aload_keys() run the synchronous azure-storage-blob
client on a thread-pool thread via asyncio.to_thread(). This is correct
for most workloads; for very high concurrency consider the async Azure SDK
(azure.storage.blob.aio).
SAS token
--8<-- "docs/scripts/storage_loaders.py:azure_sas"System-assigned or user-assigned managed identity
--8<-- "docs/scripts/storage_loaders.py:azure_managed_identity"Each returned Chunk carries:
| Key | Value |
|---|---|
source |
Full blob URL: https://<account>.blob.core.windows.net/<container>/<blob> |
account_url |
Storage account URL |
container |
Container name |
blob_name |
Blob name (path within the container) |
--8<-- "docs/scripts/storage_loaders.py:pipeline_azure_to_rag"AzureBlobWriter uploads text content to a blob container. Existing blobs at
the same name are overwritten.
--8<-- "docs/scripts/storage_writers.py:azure_write_basic"--8<-- "docs/scripts/storage_writers.py:azure_write_sas"--8<-- "docs/scripts/storage_writers.py:azure_write_async"