Rei-skills azure-storage-blob-rust
install
source · Clone the upstream repo
git clone https://github.com/rootcastleco/rei-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/rootcastleco/rei-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/azure-storage-blob-rust" ~/.claude/skills/rootcastleco-rei-skills-azure-storage-blob-rust && rm -rf "$T"
manifest:
skills/azure-storage-blob-rust/SKILL.mdsource content
Azure Blob Storage SDK for Rust
Client library for Azure Blob Storage — Microsoft's object storage solution for the cloud.
Installation
cargo add azure_storage_blob azure_identity
Environment Variables
AZURE_STORAGE_ACCOUNT_NAME=<storage-account-name> # Endpoint: https://<account>.blob.core.windows.net/
Authentication
use azure_identity::DeveloperToolsCredential; use azure_storage_blob::{BlobClient, BlobClientOptions}; let credential = DeveloperToolsCredential::new(None)?; let blob_client = BlobClient::new( "https://<account>.blob.core.windows.net/", "container-name", "blob-name", Some(credential), Some(BlobClientOptions::default()), )?;
Client Types
| Client | Purpose |
|---|---|
| Account-level operations, list containers |
| Container operations, list blobs |
| Individual blob operations |
Core Operations
Upload Blob
use azure_core::http::RequestContent; let data = b"hello world"; blob_client .upload( RequestContent::from(data.to_vec()), false, // overwrite u64::try_from(data.len())?, None, ) .await?;
Download Blob
let response = blob_client.download(None).await?; let content = response.into_body().collect_bytes().await?; println!("Content: {:?}", content);
Get Blob Properties
let properties = blob_client.get_properties(None).await?; println!("Content-Length: {:?}", properties.content_length);
Delete Blob
blob_client.delete(None).await?;
Container Operations
use azure_storage_blob::BlobContainerClient; let container_client = BlobContainerClient::new( "https://<account>.blob.core.windows.net/", "container-name", Some(credential), None, )?; // Create container container_client.create(None).await?; // List blobs let mut pager = container_client.list_blobs(None)?; while let Some(blob) = pager.try_next().await? { println!("Blob: {}", blob.name); }
Best Practices
- Use Entra ID auth —
for dev,DeveloperToolsCredential
for productionManagedIdentityCredential - Specify content length — required for uploads
- Use
— to wrap upload dataRequestContent::from() - Handle async operations — use
runtimetokio - Check RBAC permissions — ensure "Storage Blob Data Contributor" role
RBAC Permissions
For Entra ID auth, assign one of these roles:
— read-onlyStorage Blob Data Reader
— read/writeStorage Blob Data Contributor
— full access including RBACStorage Blob Data Owner
Reference Links
| Resource | Link |
|---|---|
| API Reference | https://docs.rs/azure_storage_blob |
| Source Code | https://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/storage/azure_storage_blob |
| crates.io | https://crates.io/crates/azure_storage_blob |
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
🏰 Rei Skills — Curated by Rootcastle Engineering & Innovation | Batuhan Ayrıbaş
Engineering Beyond Boundaries | admin@rootcastle.com