azure-storage-blob-rust
できること
このツールは、Rustで書かれたプログラムから、Microsoft Azureのクラウドストレージに「blob」と呼ばれるファイルを保存・取得するのに役立ちます。ファイルのアップロード、ダウンロード、管理に使えます。
使う場面
- ✓プログラムで大きなファイルをクラウドに保存する必要があるとき。
- ✓プログラムでクラウド上のファイルをダウンロードする必要があるとき。
- ✓プログラムで特定のクラウドの場所にあるファイルを一覧表示したり削除したりする必要があるとき。
スキルのリンク
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-storage-blob-rust/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Rustのプログラムから、Azure Blob Storageにファイルをアップロードするにはどうすればよいですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
このプログラムは、Azureと通信する専用の「ライブラリ」(SDK)を使います。アクセス情報を指定すると、ファイルのアップロード、ダウンロード、管理を行う専用のコマンドを使えるようになります。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Azure Blob Storage SDK for Rust
Client library for Azure Blob Storage — Microsoft's object storage solution for the cloud.
The examples below require a reviewed compatible crate set and replacement of every resource placeholder. Do not use production data for demonstration writes.
Installation
cargo add azure_storage_blob@=1.1.0 azure_identity@=1.0.0 azure_core@=1.1.0
Environment Variables
export AZURE_STORAGE_ACCOUNT_NAME="<storage-account-name>"
# Endpoint: https://<account>.blob.core.windows.net/
Authentication
use azure_identity::DeveloperToolsCredential;
use azure_core::http::Url;
use azure_storage_blob::clients::{BlobClient, BlobClientOptions};
let credential = DeveloperToolsCredential::new(None)?;
let blob_client = BlobClient::new(
Url::parse("https://<account>.blob.core.windows.net/container-name/blob-name")?,
Some(credential),
Some(BlobClientOptions::default()),
)?;
Client Types
| Client | Purpose |
|---|---|
BlobServiceClient |
Account-level operations, list containers |
BlobContainerClient |
Container operations, list blobs |
BlobClient |
Individual blob operations |
Core Operations
Upload Blob
use azure_core::http::RequestContent;
use azure_storage_blob::models::BlobClientUploadOptions;
let data = b"hello world";
blob_client
.upload(
RequestContent::from(data.to_vec()),
Some(BlobClientUploadOptions::if_not_exists()), // fail rather than overwrite an existing blob
)
.await?;
Download Blob
let response = blob_client.download(None).await?;
// Check the approved size before fetching; use download_into with a bounded buffer for large data.
let content = response.body.collect().await?;
// Process authorized bytes; do not log the payload.
Get Blob Properties
let properties = blob_client.get_properties(None).await?;
// Read the version-specific response header trait; properties is a response, not a content_length field.
// Do not infer a body/size limit from successful metadata access alone.
Delete Blob
blob_client.delete(None).await?;
Container Operations
use azure_storage_blob::clients::BlobContainerClient;
use futures::TryStreamExt;
let container_client = BlobContainerClient::new(
Url::parse("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(page) = pager.try_next().await? {
let listing = page.into_model()?;
// Process this listing page; apply an explicit maximum-page budget.
}
Best Practices
- Use Entra ID auth —
DeveloperToolsCredentialfor dev,ManagedIdentityCredentialfor production - Review overwrite behavior — the reviewed upload API uses options; if_not_exists prevents unintended replacement
- Use
RequestContent::from()— to wrap upload data - Handle async operations — use
tokioruntime - Check RBAC permissions — ensure "Storage Blob Data Contributor" role
RBAC Permissions
For Entra ID auth, assign one of these roles:
Storage Blob Data Reader— read-onlyStorage Blob Data Contributor— read/writeStorage Blob Data Owner— blob-data access and supported ownership/ACL management; it does not grant general Azure RBAC role-assignment authority
The example API follows BlobClient 1.1.0; earlier releases used different constructor/upload signatures. Use the project’s compatible Azure crate versions rather than mixing them.
The reviewed example set uses azure_storage_blob 1.1.0 and compatible Azure core/credential crates. Record and commit Cargo.lock; source/API review is not a compiler or live-service test.
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
Use when a Rust application uploads/downloads a specified Azure blob, reads its properties or manages an authorized container.
Limitations
…
よくある質問
「blob」とは何ですか?
Azureに保存されたファイルを指す技術用語です。写真、文書、その他どんな種類のデータでもかまいません。
「クラウドストレージ」とは何ですか?
自分のパソコンではなく、インターネット経由でアクセスする遠隔地のコンピュータ(サーバー)にファイルを保存する場所のことです。
このツールを使うには、Azureのプログラミングの知識が必要ですか?
このSDKは、すでにRustでプログラミングをしている人向けです。Azureとのやり取りを簡単にしてくれますが、Azureの基本的な仕組みやRustのプログラミングの基礎知識は必要です。
詳細
作者による元の説明
Azure Blob Storage SDK for Rust. Use for uploading, downloading, and managing blobs and containers.
人気
- GitHubのスター
- 48k
- ランキング
- #3994
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
00-andruia-consultant
48kエージェントがAIプロジェクトの立ち上げや改善を支援します。コードを分析し、ツールを提案し、スペイン語で行動計画を作成します。
007
48kエージェントがセキュリティ監査と脅威モデリングを行えるようにします。攻撃や脆弱性からプロジェクトを守るのに役立ちます。
10-andruia-skill-smith
48kエージェントがAIツールの作成や改善を支援します。ツールの動作を定義し、ドキュメントを書き、構造を検証します。
20-andruia-niche-intelligence
48kエージェントが特定の業界に関する要約を作成できるようにします。信頼できる情報源を使って、プロジェクトの背景、ルール、利用パターン、リスクを把握するのに役立ちます。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。