azure-storage-blob-rust 是什么?
azure-storage-blob-rust 介绍官方azure_storage_blob crate的容器和Blob操作,特别说明身份类型、RequestContent上传、响应体读取,以及1.x列表迭代直接返回BlobItem的形状。适合修正误用旧社区crate和内部生成模型的Rust存储代码。
中文说明由本站依据来源整理;英文原文保留在页面下方。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
azure-storage-blob-rust,然后按本页使用示例提供材料。
展开并复制给 Codex 的安装指令
安装并检查 azure-storage-blob-rust
请在 Codex 的当前工作环境中安装并检查 azure-storage-blob-rust 这个 Skill。
项目身份:microsoft/skills / azure-storage-blob-rust
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-rust/skills/azure-storage-blob-rust/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-rust/skills/azure-storage-blob-rust/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 azure-storage-blob-rust
请在 Claude Code 的当前工作环境中安装并检查 azure-storage-blob-rust 这个 Skill。
项目身份:microsoft/skills / azure-storage-blob-rust
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-rust/skills/azure-storage-blob-rust/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-rust/skills/azure-storage-blob-rust/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 azure-storage-blob-rust
请在 Cursor Agent 的当前工作环境中安装并检查 azure-storage-blob-rust 这个 Skill。
项目身份:microsoft/skills / azure-storage-blob-rust
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-rust/skills/azure-storage-blob-rust/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-rust/skills/azure-storage-blob-rust/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 azure-storage-blob-rust
请在 当前 Agent 的当前工作环境中安装并检查 azure-storage-blob-rust 这个 Skill。
项目身份:microsoft/skills / azure-storage-blob-rust
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-rust/skills/azure-storage-blob-rust/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-rust/skills/azure-storage-blob-rust/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。装好以后,具体怎么用?
准备哪些材料
- 确认存储账户/真实endpoint、容器和Blob名称,添加官方azure_storage_blob及需要的identity/core/tokio/futures依赖;读取与写入分别准备Blob数据角色。
会得到什么
- 官方crate的Rust存储代码、分页/可选属性处理及可定位错误记录。
实际使用顺序
- 以BlobServiceClient为入口派生container/blob客户端;本地用DeveloperToolsCredential,Azure按环境用ManagedIdentityCredential,不导入绑定版本不存在的DefaultAzureCredential。
- 上传内容转RequestContent,下载通过response.body.collect读取;二进制文件保持字节,不默认按UTF-8解码。列表通过try_next逐item处理,不再误加嵌套page.blob_items循环。
- 对blob.name及content_length等Option字段提供缺省分支;HTTP错误转换为StorageError时传拥有所有权的error,分别报告BlobNotFound、ContainerNotFound、AuthorizationFailure和request_id。
从一个具体任务开始
本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。
复制一个具体任务
教学任务:使用 azure-storage-blob-rust,为我已有容器写只读Blob名称与长度清单,采用官方1.x分页形状,正确处理Option字段和StorageError。不要创建容器、上传或删除Blob,不假设内容是UTF-8。预期得到可供编译审查的只读Rust程序;本站未编译或访问存储。
使用条件与边界
- 此处官方crate为azure_storage_blob,azure_storage_blobs等社区crate的API不可混用。
- 源文Owner角色概括不能替代具体账户的数据权限核对;下载collect会把内容聚合,不能无条件承诺适合超大文件。
常见问题
try_next返回后为什么还找不到page.blob_items?
源说明该1.x用法的pager直接产生BlobItem,不是包了一层items的页对象。应以实际crate示例为准,不能套其他SDK的分页类型。
来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
- 中文使用说明
- 已针对下方源文件版本整理用途、用法和常见问题
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料
.github/plugins/azure-sdk-rust/skills/azure-storage-blob-rust/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
Azure Blob Storage library for Rust. Upload, download, and manage blobs and containers. Triggers: "blob storage rust", "BlobClient rust", "upload blob rust", "download blob rust", "storage container rust", "BlobServiceClient rust".
查看源文件章节 / Source sections
- 原文:Azure Blob Storage library for Rust
- 安装 / Installation
- 原文:Environment Variables
- 原文:Authentication
- 原文:Client Types
- 原文:Core Workflow
- 原文:Upload Blob
- 原文:Download Blob / Get Properties
- 原文:Delete Blob
- 原文:Container Operations
- 原文:Error Handling
- 原文:RBAC Roles
- 原文:Best Practices
- 原文:Common Rust Blob Pitfalls
- 原文:Reference Links
原文:Azure Blob Storage library for Rust
Client library for Azure Blob Storage — upload, download, and manage blobs and containers. Use this skill when: - An app needs to upload or download blobs from Azure Storage in Rust - You need to create or manage blob containers - You need to list blobs with pagination - You need RBAC-based auth for blob operations > **IMPORTANT:** Only use the official `azure_storage_blob` crate published by the [azure-sdk](https://crates.io/users/azure-sdk) crates.io user. Do NOT use the unofficial `azure_storage`, `azure_storage_blobs`, or `azure_sdk_for_rust` community crates. Official crates use underscores in names and none have version 0.21.0.
安装 / Installation
```sh cargo add azure_storage_blob azure_identity azure_core tokio futures ``` > If your code uses `azure_core` types directly (for example, `azure_core::http::Url` or `azure_core::http::RequestContent`), add `azure_core` to `Cargo.toml`. If you only use `azure_storage_blob` re-exports, direct `azure_core` dependency is optional.
原文:Environment Variables
```bash AZURE_STORAGE_ACCOUNT=<account-name> # Preferred when the caller gives an account name AZURE_STORAGE_ENDPOINT=https://<account>.blob.core.windows.net/ # Optional alternative when the caller gives a full endpoint ``` When both are available, prefer constructing the endpoint from `AZURE_STORAGE_ACCOUNT` so the code matches common evaluation prompts.
原文:Authentication
Rust Azure SDK code must not use `DefaultAzureCredential`. The Rust identity crate does not provide that type. ```rust // Correct for local development use azure_identity::DeveloperToolsCredential; let credential = DeveloperToolsCredential::new(None)?; ``` ```rust // Incorrect in Rust: this type does not exist in azure_identity use azure_identity::DefaultAzureCredential; ``` ```rust use azure_core::http::Url; use azure_identity::DeveloperToolsCredential; use azure_storage_blob::BlobServiceClient; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { // Local dev: DeveloperToolsCredential. Production: use ManagedIdentityCredential. let credential = DeveloperToolsCredential::new(None)?; let service_url = Url::parse("https://<storage_account_name>.blob.core.windows.net/")?; let service_client = BlobServiceClient::new( service_url, Some(credential), None, )?; // Derive container and blob clients by name. let container_client = service_client.blob_container_client("<container_name>"); let blob_client = container_client.blob_client("<blob_name>"); Ok(()) } ```
原文:Client Types
| Client | Purpose | | --------------------- | ----------------------------------------- | | `BlobServiceClient` | Account-level operations, list containers | | `BlobContainerClient` | Container operations, list blobs | | `BlobClient` | Individual blob operations |
原文:Upload Blob
```rust use azure_core::http::{RequestContent, Url}; use azure_identity::DeveloperToolsCredential; use azure_storage_blob::BlobServiceClient; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { // Local dev: DeveloperToolsCredential. Production: use ManagedIdentityCredential. let credential = DeveloperToolsCredential::new(None)?; let service_url = Url::parse("https://<storage_account_name>.blob.core.windows.net/")?; let service_client = BlobServiceClient::new(service_url, Some(credential), None)?; let blob_client = service_client.blob_client("<container_name>", "<blob_name>"); let data = b"hello world"; blob_client.upload(RequestContent::from(data.to_vec()), None).await?; Ok(()) } ```
文件 SHA256:6750e050df436fe23223dfe4cacaf9067f3d16ed10f6b9137453b0cb7bcd0b9b
仓库许可证记录:MIT;skill-declaration-captured-not-interpreted,查看来源。
Azure Blob Storage library for Rust. Upload, download, and manage blobs and containers. Triggers: "blob storage rust", "BlobClient rust", "upload blob rust", "download blob rust", "storage container rust", "BlobServiceClient rust".
历史收录数据
| 来源仓库 | microsoft/skills |
|---|---|
| Skill源路径 | .github/plugins/azure-sdk-rust/skills/azure-storage-blob-rust/SKILL.md |
安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。
