Skill 寫法圖鑑

azure-storage

Microsoft | 雲端與基礎設施 | 原文 | MIT

Azure Storage 各服務與存取層級、備援選項的速查與操作

中文翻譯

---
name: azure-storage
description: "Azure Storage 服務,包含 Blob Storage、File Shares、Queue Storage、Table Storage 和 Data Lake。可回答儲存存取層(hot、cool、cold、archive)、各層什麼時候用、層級比較等問題。提供物件儲存、SMB 檔案共用、非同步訊息、NoSQL key-value 和大數據分析,也包含生命週期管理。USE FOR: blob storage, file shares, queue storage, table storage, data lake, upload files, download blobs, storage accounts, access tiers, storage tiers, hot cool cold archive, storage tier comparison, when to use storage tiers, lifecycle management, Azure Storage concepts. DO NOT USE FOR: SQL databases、Cosmos DB(用 azure-prepare)、搭配 Event Hubs 或 Service Bus 的訊息服務(用 azure-messaging)。"
license: MIT
metadata:
  author: Microsoft
  version: "1.2.2"
---

# Azure Storage 服務

## 服務

| 服務 | 使用時機 | MCP 工具 | CLI |
|---------|----------|-----------|-----|
| Blob Storage | 物件、檔案、備份、靜態內容 | `azure__storage` | `az storage blob` |
| File Shares | SMB 檔案共用、lift-and-shift | - | `az storage file` |
| Queue Storage | 非同步訊息、工作 queue | - | `az storage queue` |
| Table Storage | NoSQL key-value(可考慮 Cosmos DB) | - | `az storage table` |
| Data Lake | 大數據分析、hierarchical namespace | - | `az storage fs` |

## MCP Server(優先使用)

啟用 Azure MCP 時:

- `azure__storage` 搭配 command `storage_account_list` - 列出 storage account
- `azure__storage` 搭配 command `storage_container_list` - 列出 account 裡的 container
- `azure__storage` 搭配 command `storage_blob_list` - 列出 container 裡的 blob
- `azure__storage` 搭配 command `storage_blob_get` - 下載 blob 內容
- `azure__storage` 搭配 command `storage_blob_put` - 上傳 blob 內容

**如果 Azure MCP 沒有啟用:** 在 Copilot CLI 或 Claude Code 裡,請使用者執行 `/mcp` 並啟用 Azure MCP;在其他 host,請使用者透過該 host 的 MCP 設定啟用 Azure MCP。

## CLI 備援

```bash
# 列出 storage account
az storage account list --output table

# 列出 container
az storage container list --account-name ACCOUNT --output table

# 列出 blob
az storage blob list --account-name ACCOUNT --container-name CONTAINER --output table

# 下載 blob
az storage blob download --account-name ACCOUNT --container-name CONTAINER --name BLOB --file LOCAL_PATH

# 上傳 blob
az storage blob upload --account-name ACCOUNT --container-name CONTAINER --name BLOB --file LOCAL_PATH
```

## Storage Account 層級

| 層級 | 使用情境 | 效能 |
|------|----------|-------------|
| Standard | 通用、備份 | 毫秒等級 |
| Premium | 資料庫、高 IOPS | 次毫秒等級 |

## Blob 存取層

| 層級 | 存取頻率 | 成本 |
|------|-----------------|------|
| Hot | 頻繁 | 儲存成本較高,存取成本較低 |
| Cool | 不常存取(30 天以上) | 儲存成本較低,存取成本較高 |
| Cold | 很少存取(90 天以上) | 更低 |
| Archive | 極少存取(180 天以上) | 儲存成本最低,需要 rehydration |

## 備援選項

| 類型 | 耐久性 | 使用情境 |
|------|------------|----------|
| LRS | 11 個 9 | Dev/test、可重建的資料 |
| ZRS | 12 個 9 | 區域內的高可用性 |
| GRS | 16 個 9 | 災難復原 |
| GZRS | 16 個 9 | 最佳耐久性 |

## 服務細節

想深入了解各個服務的文件:

- Blob storage 模式和生命週期 -> [Blob Storage documentation](https://learn.microsoft.com/azure/storage/blobs/storage-blobs-overview)
- File shares 和 Azure File Sync -> [Azure Files documentation](https://learn.microsoft.com/azure/storage/files/storage-files-introduction)
- Queue 模式和 poison 處理 -> [Queue Storage documentation](https://learn.microsoft.com/azure/storage/queues/storage-queues-introduction)

## SDK 快速參考

要用 Azure Storage SDK 建構應用程式,請看這些精簡指南:

- **Blob Storage**:[Python](references/sdk/azure-storage-blob-py.md) | [TypeScript](references/sdk/azure-storage-blob-ts.md) | [Java](references/sdk/azure-storage-blob-java.md) | [Rust](references/sdk/azure-storage-blob-rust.md)
- **Queue Storage**:[Python](references/sdk/azure-storage-queue-py.md) | [TypeScript](references/sdk/azure-storage-queue-ts.md)
- **File Shares**:[Python](references/sdk/azure-storage-file-share-py.md) | [TypeScript](references/sdk/azure-storage-file-share-ts.md)
- **Data Lake**:[Python](references/sdk/azure-storage-file-datalake-py.md)
- **Tables**:[Python](references/sdk/azure-data-tables-py.md) | [Java](references/sdk/azure-data-tables-java.md)

各語言完整的套件清單,請看 [SDK Usage Guide](references/sdk-usage.md)。

## Azure SDK

要建構以程式方式操作 Azure Storage 的應用程式,Azure 提供多種語言(.NET、Java、JavaScript、Python、Go、Rust)的 SDK 套件。套件名稱、安裝指令和快速開始範例請看 [SDK Usage Guide](references/sdk-usage.md)。

英文原文

---
name: azure-storage
description: "Azure Storage Services including Blob Storage, File Shares, Queue Storage, Table Storage, and Data Lake. Answers questions about storage access tiers (hot, cool, cold, archive), when to use each tier, and tier comparison. Provides object storage, SMB file shares, async messaging, NoSQL key-value, and big data analytics. Includes lifecycle management. USE FOR: blob storage, file shares, queue storage, table storage, data lake, upload files, download blobs, storage accounts, access tiers, storage tiers, hot cool cold archive, storage tier comparison, when to use storage tiers, lifecycle management, Azure Storage concepts. DO NOT USE FOR: SQL databases, Cosmos DB (use azure-prepare), messaging with Event Hubs or Service Bus (use azure-messaging)."
license: MIT
metadata:
  author: Microsoft
  version: "1.2.2"
---

# Azure Storage Services

## Services

| Service | Use When | MCP Tools | CLI |
|---------|----------|-----------|-----|
| Blob Storage | Objects, files, backups, static content | `azure__storage` | `az storage blob` |
| File Shares | SMB file shares, lift-and-shift | - | `az storage file` |
| Queue Storage | Async messaging, task queues | - | `az storage queue` |
| Table Storage | NoSQL key-value (consider Cosmos DB) | - | `az storage table` |
| Data Lake | Big data analytics, hierarchical namespace | - | `az storage fs` |

## MCP Server (Preferred)

When Azure MCP is enabled:

- `azure__storage` with command `storage_account_list` - List storage accounts
- `azure__storage` with command `storage_container_list` - List containers in account
- `azure__storage` with command `storage_blob_list` - List blobs in container
- `azure__storage` with command `storage_blob_get` - Download blob content
- `azure__storage` with command `storage_blob_put` - Upload blob content

**If Azure MCP is not enabled:** In Copilot CLI or Claude Code, ask the user to run `/mcp` and enable Azure MCP; in other hosts, ask the user to enable Azure MCP through the host's MCP configuration.

## CLI Fallback

```bash
# List storage accounts
az storage account list --output table

# List containers
az storage container list --account-name ACCOUNT --output table

# List blobs
az storage blob list --account-name ACCOUNT --container-name CONTAINER --output table

# Download blob
az storage blob download --account-name ACCOUNT --container-name CONTAINER --name BLOB --file LOCAL_PATH

# Upload blob
az storage blob upload --account-name ACCOUNT --container-name CONTAINER --name BLOB --file LOCAL_PATH
```

## Storage Account Tiers

| Tier | Use Case | Performance |
|------|----------|-------------|
| Standard | General purpose, backup | Milliseconds |
| Premium | Databases, high IOPS | Sub-millisecond |

## Blob Access Tiers

| Tier | Access Frequency | Cost |
|------|-----------------|------|
| Hot | Frequent | Higher storage, lower access |
| Cool | Infrequent (30+ days) | Lower storage, higher access |
| Cold | Rare (90+ days) | Lower still |
| Archive | Rarely (180+ days) | Lowest storage, rehydration required |

## Redundancy Options

| Type | Durability | Use Case |
|------|------------|----------|
| LRS | 11 nines | Dev/test, recreatable data |
| ZRS | 12 nines | Regional high availability |
| GRS | 16 nines | Disaster recovery |
| GZRS | 16 nines | Best durability |

## Service Details

For deep documentation on specific services:

- Blob storage patterns and lifecycle -> [Blob Storage documentation](https://learn.microsoft.com/azure/storage/blobs/storage-blobs-overview)
- File shares and Azure File Sync -> [Azure Files documentation](https://learn.microsoft.com/azure/storage/files/storage-files-introduction)
- Queue patterns and poison handling -> [Queue Storage documentation](https://learn.microsoft.com/azure/storage/queues/storage-queues-introduction)

## SDK Quick References

For building applications with Azure Storage SDKs, see the condensed guides:

- **Blob Storage**: [Python](references/sdk/azure-storage-blob-py.md) | [TypeScript](references/sdk/azure-storage-blob-ts.md) | [Java](references/sdk/azure-storage-blob-java.md) | [Rust](references/sdk/azure-storage-blob-rust.md)
- **Queue Storage**: [Python](references/sdk/azure-storage-queue-py.md) | [TypeScript](references/sdk/azure-storage-queue-ts.md)
- **File Shares**: [Python](references/sdk/azure-storage-file-share-py.md) | [TypeScript](references/sdk/azure-storage-file-share-ts.md)
- **Data Lake**: [Python](references/sdk/azure-storage-file-datalake-py.md)
- **Tables**: [Python](references/sdk/azure-data-tables-py.md) | [Java](references/sdk/azure-data-tables-java.md)

For full package listing across all languages, see [SDK Usage Guide](references/sdk-usage.md).

## Azure SDKs

For building applications that interact with Azure Storage programmatically, Azure provides SDK packages in multiple languages (.NET, Java, JavaScript, Python, Go, Rust). See [SDK Usage Guide](references/sdk-usage.md) for package names, installation commands, and quick start examples.