Authenticate to the storage account using a storage account key, a managed identity token (preferred in Azure-hosted workloads), or a service principal credential; initialize a BlobServiceClient with the account URL and credential
For files larger than 256 MiB (or to parallelize), use staged block uploads: split the file into blocks (up to 4000 MiB each, max 50,000 blocks), upload each block with Put Block (PUT /{container}/{blob}?comp=block&blockid={base64-id}), then commit with Put Block List (PUT /{container}/{blob}?comp=blocklist)
Stage blocks in parallel for throughput; the Azure SDK's upload_blob method with max_concurrency parameter handles this automatically for local file uploads
Generate a Service SAS token using BlobSasPermissions, an expiry time, and the account key or a user delegation key (preferred — does not embed the account key); encode the SAS and append it as a query string to the blob URL
For user delegation SAS, first obtain a UserDelegationKey via the storage service (valid up to 7 days) using a principal with the Storage Blob Delegator role; sign the SAS with this key instead of the account key
Set Content-Disposition and Cache-Control headers when generating the SAS or at upload time to control how browsers handle the download
Known gotchas
Block IDs must all be the same byte length when base64-encoded within a single blob — mixing lengths in the block list causes a 400 InvalidBlockList error
SAS tokens generated with the account key remain valid even after key rotation if the expiry has not passed — always use short expiry windows and prefer user delegation SAS which are automatically invalidated when the delegation key expires
Uncommitted blocks that are never finalized with Put Block List are automatically garbage-collected after 7 days but still count against storage capacity during that window
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp