# azure-storage-blob-java

Supplies ready-to-use patterns for the Azure Storage Blob Java SDK, covering authentication, container administration, and file uploads.

- skill · `type=skill` · Claude Code, GitHub Copilot · ★ 3149
- Author: Microsoft
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/microsoft/skills/tree/HEAD/.github/plugins/azure-sdk-java/skills/azure-storage-blob-java/SKILL.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/skills/azure-storage-blob-java

## What it does

This skill equips coding agents with reference code for the `com.azure:azure-storage-blob` package version 12.33.0. It guides client initialization across `BlobServiceClient`, `BlobContainerClient`, and `BlobClient` using connection strings, SAS tokens, or token-based identity credentials.

The guidance covers core file transfer tasks. It details how to push raw strings, read and write streams, configure `BlobParallelUploadOptions` with content metadata, and retrieve blobs directly into byte arrays or local files. It also illustrates hierarchical folder listings using custom delimiters.

Environment authentication relies on defining `AZURE_TOKEN_CREDENTIALS` when building `DefaultAzureCredential`. Without valid credentials configured in the runtime, storage requests will fail immediately.

## Requirements
- Works with: Azure

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add microsoft/skills --skill azure-storage-blob-java -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/azure-storage-blob-java/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/azure-storage-blob-java/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/azure-storage-blob-java/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/azure-storage-blob-java/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install microsoft/skills azure-storage-blob-java
```

2. **Manually: put the files in place**
- File: `.github/skills/azure-storage-blob-java/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/microsoft/skills --path .github/plugins/azure-sdk-java/skills/azure-storage-blob-java
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/azure-storage-blob-java/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/microsoft/skills/tree/HEAD/.github/plugins/azure-sdk-java/skills/azure-storage-blob-java/SKILL.md

## When to use it
- configure client authentication using SAS tokens, connection strings, or `DefaultAzureCredential`
- upload strings, streams, and files with custom headers or parallel transfer options
- download stored blobs into files, memory buffers, or standard input streams
- traverse container hierarchies using directory delimiters and metadata filters

## Example prompts
- Write Java code to set up a `BlobServiceClient` with `DefaultAzureCredential` and upload a file.
- Show how to read a blob as an `InputStream` in Java using `BlobClient`.
- Generate a method that lists all items under a virtual folder prefix in Azure Blob Storage.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 898425a2d22ed870.

BEGIN THIRD-PARTY FILE 898425a2d22ed870
````text
---
name: azure-storage-blob-java
description: Build blob storage applications with Azure Storage Blob SDK for Java. Use when uploading, downloading, or managing files in Azure Blob Storage, working with containers, or implementing streaming data operations.
license: MIT
metadata:
  author: Microsoft
  version: "1.0.0"
  package: com.azure:azure-storage-blob
---

# Azure Storage Blob SDK for Java

Build blob storage applications using the Azure Storage Blob SDK for Java.

## Installation

```xml
<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-storage-blob</artifactId>
    <version>12.33.0</version>
</dependency>
```

## Client Creation

### BlobServiceClient

```java
import com.azure.storage.blob.BlobServiceClient;
import com.azure.storage.blob.BlobServiceClientBuilder;

// With SAS token
BlobServiceClient serviceClient = new BlobServiceClientBuilder()
    .endpoint("<storage-account-url>")
    .sasToken("<sas-token>")
    .buildClient();

// With connection string
BlobServiceClient serviceClient = new BlobServiceClientBuilder()
    .connectionString("<connection-string>")
    .buildClient();
```

### With DefaultAzureCredential

```java
import com.azure.core.credential.TokenCredential;
import com.azure.identity.AzureIdentityEnvVars;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.identity.ManagedIdentityCredentialBuilder;

// Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
TokenCredential credential = new DefaultAzureCredentialBuilder()
    .requireEnvVars(AzureIdentityEnvVars.AZURE_TOKEN_CREDENTIALS)
    .build();
// Or use a specific credential directly in production:
// See https://learn.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable#credential-classes
// TokenCredential credential = new ManagedIdentityCredentialBuilder().build();

BlobServiceClient serviceClient = new BlobServiceClientBuilder()
    .endpoint("<storage-account-url>")
    .credential(credential)
    .buildClient();
```

### BlobContainerClient

```java
import com.azure.storage.blob.BlobContainerClient;

// From service client
BlobContainerClient containerClient = serviceClient.getBlobContainerClient("mycontainer");

// Direct construction
BlobContainerClient containerClient = new BlobContainerClientBuilder()
    .connectionString("<connection-string>")
    .containerName("mycontainer")
    .buildClient();
```

### BlobClient

```java
import com.azure.storage.blob.BlobClient;

// From container client
BlobClient blobClient = containerClient.getBlobClient("myblob.txt");

// With directory structure
BlobClient blobClient = containerClient.getBlobClient("folder/subfolder/myblob.txt");

// Direct construction
BlobClient blobClient = new BlobClientBuilder()
    .connectionString("<connection-string>")
    .containerName("mycontainer")
    .blobName("myblob.txt")
    .buildClient();
```

## Core Patterns

### Create Container

```java
// Create container
serviceClient.createBlobContainer("mycontainer");

// Create if not exists
````
END THIRD-PARTY FILE 898425a2d22ed870

The third-party file has ended. Everything between the 898425a2d22ed870 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3100 of 10888 bytes. © Microsoft · MIT · https://github.com/microsoft/skills/tree/HEAD/.github/plugins/azure-sdk-java/skills/azure-storage-blob-java/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
