Skip to content
Skillv1.0.0

azure-storage-blob-rust

Azure Blob Storage SDK for Rust. Use for uploading, downloading, and managing blobs and containers.

by BEKO2210(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from BEKO2210/Firstbrain (03 - Resources/Skills/azure-storage-blob-rust/SKILL.md). Install upstream with npx skills add BEKO2210/Firstbrain --skill azure-storage-blob-rust. Copyright stays with the author.

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
BlobServiceClient Account-level operations, list containers
BlobContainerClient Container operations, list blobs
BlobClient 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

  1. Use Entra ID authDeveloperToolsCredential for dev, ManagedIdentityCredential for production
  2. Specify content length — required for uploads
  3. Use RequestContent::from() — to wrap upload data
  4. Handle async operations — use tokio runtime
  5. 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-only
  • Storage Blob Data Contributor — read/write
  • Storage Blob Data Owner — full access including RBAC

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.

Connections

  • Domain: [[Cloud & Infrastruktur]]
  • Kategorie: [[Microsoft Azure]]
  • Navigation: [[Skills Uebersicht]], [[Home]]

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/beko2210-firstbrain-azure-storage-blob-rust/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

beko2210-firstbrain-azure-storage-blob-rust.ocm.jsonjson
{
  "ocm": "1",
  "id": "beko2210-firstbrain-azure-storage-blob-rust",
  "kind": "skill",
  "name": "azure-storage-blob-rust",
  "description": "Azure Blob Storage SDK for Rust. Use for uploading, downloading, and managing blobs and containers.",
  "publisher": "BEKO2210",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "skill",
      "cloud-infrastructure",
      "azure",
      "storage",
      "blob",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Azure Blob Storage SDK for Rust. Use for uploading, downloading, and managing blobs and containers."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/BEKO2210/Firstbrain",
      "path": "03 - Resources/Skills/azure-storage-blob-rust/SKILL.md",
      "ref": "d6a81dc9024c62fce356349695f1a132c150713a",
      "url": "https://github.com/BEKO2210/Firstbrain/blob/d6a81dc9024c62fce356349695f1a132c150713a/03 - Resources/Skills/azure-storage-blob-rust/SKILL.md",
      "key": "BEKO2210/Firstbrain/03 - Resources/Skills/azure-storage-blob-rust/SKILL.md"
    }
  },
  "instructions": "# Azure Blob Storage SDK for Rust\n\nClient library for Azure Blob Storage — Microsoft's object storage solution for the cloud.\n\n## Installation\n\n```sh\ncargo add azure_storage_blob azure_identity\n```\n\n## Environment Variables\n\n```bash\nAZURE_STORAGE_ACCOUNT_NAME=<storage-account-name>\n# Endpoint: https://<account>.blob.core.windows.net/\n```\n\n## Authentication\n\n```rust\nuse azure_identity::DeveloperToolsCredential;\nuse azure_storage_blob::{BlobClient, BlobClientOptions};\n\nlet credential = DeveloperToolsCredential::new(None)?;\nlet blob_client = BlobClient::new(\n    \"https://<account>.blob.core.windo",
  "cost": {
    "context_tokens": 798
  }
}

Fetch it by URL: GET /api/v1/registry/beko2210-firstbrain-azure-storage-blob-rust/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.