azure-storage-queue-py 是什么?
azure-storage-queue-py 用于Python异步任务分发,覆盖JSON发送、peek监控、receive后的可见性窗口、删除与dequeue_count。队列将消息临时隐藏供处理,业务成功后删除;它不是自动保证每项任务只执行一次的任务框架。
中文说明由本站依据来源整理;英文原文保留在页面下方。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
azure-storage-queue-py,然后按本页使用示例提供材料。
展开并复制给 Codex 的安装指令
安装并检查 azure-storage-queue-py
请在 Codex 的当前工作环境中安装并检查 azure-storage-queue-py 这个 Skill。
项目身份:microsoft/skills / azure-storage-queue-py
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-python/skills/azure-storage-queue-py/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-python/skills/azure-storage-queue-py/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 azure-storage-queue-py
请在 Claude Code 的当前工作环境中安装并检查 azure-storage-queue-py 这个 Skill。
项目身份:microsoft/skills / azure-storage-queue-py
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-python/skills/azure-storage-queue-py/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-python/skills/azure-storage-queue-py/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 azure-storage-queue-py
请在 Cursor Agent 的当前工作环境中安装并检查 azure-storage-queue-py 这个 Skill。
项目身份:microsoft/skills / azure-storage-queue-py
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-python/skills/azure-storage-queue-py/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-python/skills/azure-storage-queue-py/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 azure-storage-queue-py
请在 当前 Agent 的当前工作环境中安装并检查 azure-storage-queue-py 这个 Skill。
项目身份:microsoft/skills / azure-storage-queue-py
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-python/skills/azure-storage-queue-py/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-python/skills/azure-storage-queue-py/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。装好以后,具体怎么用?
准备哪些材料
- 配置azure-storage-queue与azure-identity、queue endpoint和名称;明确任务耗时、TTL、重复执行处理方式与失败消息处置,选择同步或aio。
会得到什么
- Python worker处理链路、可见性和失败重试规则,以及只读监控入口。
实际使用顺序
- 只看队列用get_queue_properties/peek_messages,消息数是approximate;发送结构化任务先JSON序列化,并统一发送端/接收端编码策略。
- Worker通过receive_messages取得消息并设置visibility_timeout,成功处理后delete_message。处理超时用update_message延长窗口并按SDK返回更新receipt,失败保留状态等待重试。
- 依据dequeue_count发现反复失败的消息并设计隔离策略,不能用clear_messages清全队列来处理单项失败;异步credential和client都要async with关闭,源末尾片段需补该生命周期。
从一个具体任务开始
本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。
复制一个具体任务
教学任务:使用 azure-storage-queue-py,为图像生成任务设计Worker,正常耗时90秒。请说明visibility_timeout、续期和成功后删除的顺序,如何按任务id避免重复副作用、记录dequeue_count并隔离反复失败项。只给设计,不receive或清理线上队列。预期得到耗时和重试语义明确的Worker设计;本站未执行任务。
使用条件与边界
- TTL是消息保留时间,可见性是本次消费窗口,二者不能混为同一个超时。
- 内置peek不会像receive那样隐藏消息;业务幂等和毒消息队列不是安装SDK后自动存在。
常见问题
已经receive为什么还会再次出现?
receive只是暂时隐藏。处理未完成或未成功delete时,窗口结束后消息可再见;应检查耗时、续期、删除结果和重复执行处理。
来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
- 中文使用说明
- 已针对下方源文件版本整理用途、用法和常见问题
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料
.github/plugins/azure-sdk-python/skills/azure-storage-queue-py/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
Azure Queue Storage SDK for Python. Use for reliable message queuing, task distribution, and asynchronous processing. Triggers: "queue storage", "QueueServiceClient", "QueueClient", "message queue", "dequeue".
查看源文件章节 / Source sections
- 原文:Azure Queue Storage SDK for Python
- 安装 / Installation
- 原文:Environment Variables
- 原文:Authentication & Lifecycle
- 原文:Queue Operations
- 原文:Send Messages
- 原文:Receive Messages
- 原文:Peek Messages
- 原文:Update Message
- 原文:Delete Message
- 原文:Clear Queue
- 原文:Queue Properties
- 原文:Async Client
- 原文:Base64 Encoding
- 原文:Best Practices
- 原文:Reference Files
原文:Azure Queue Storage SDK for Python
Simple, cost-effective message queuing for asynchronous communication.
安装 / Installation
```bash pip install azure-storage-queue azure-identity ```
原文:Environment Variables
```bash AZURE_STORAGE_ACCOUNT_URL=https://<account>.queue.core.windows.net # Required for all auth methods AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production ```
原文:Authentication & Lifecycle
> **🔑 Two rules apply to every code sample below:** > > 1. **Prefer `DefaultAzureCredential`.** It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation. > - Local dev: `DefaultAzureCredential` works as-is. > - Production: set `AZURE_TOKEN_CREDENTIALS=prod` (or `AZURE_TOKEN_CREDENTIALS=<specific_credential>`) to constrain the credential chain to production-safe credentials. > 2. **Wrap every client in a context manager** so HTTP transports, sockets, and token caches are released deterministically: > - Sync: `with <Client>(...) as client:` > - Async: `async with <Client>(...) as client:` **and** `async with DefaultAzureCredential() as credential:` (from `azure.identity.aio`) > > Snippets may abbreviate this setup, but production code should always follow both rules. ```python from azure.identity import DefaultAzureCredential, ManagedIdentityCredential from azure.storage.queue import QueueServiceClient, QueueClient # Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential> credential = DefaultAzureCredential(require_envvar=True) # Or use a specific credential directly in production: # See https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python#credential-classes # credential = ManagedIdentityCredential() account_url = "https://<account>.queue.core.windows.net" # Service client with QueueServiceClient(account_url=account_url, credential=credential) as service_client: # Use service_client here (see following sections for operations) ... # Queue client with QueueClient(account_url=account_url, queue_name="myqueue", credential=credential) as queue_client: # Use queue_client here (see following sections for operations) ... ```
原文:Queue Operations
```python # Create queue service_client.create_queue("myqueue") # Get queue client queue_client = service_client.get_queue_client("myqueue") # Delete queue service_client.delete_queue("myqueue") # List queues for queue in service_client.list_queues(): print(queue.name) ```
原文:Send Messages
```python # Send message (string) queue_client.send_message("Hello, Queue!") # Send with options queue_client.send_message( content="Delayed message", visibility_timeout=60, # Hidden for 60 seconds time_to_live=3600 # Expires in 1 hour ) # Send JSON import json data = {"task": "process", "id": 123} queue_client.send_message(json.dumps(data)) ```
文件 SHA256:7a348472e13aaafa5d631b39dc9198d5b90123ea00b4cac4d359cbcaf886bc45
仓库许可证记录:MIT;skill-declaration-captured-not-interpreted,查看来源。
Azure Queue Storage SDK for Python. Use for reliable message queuing, task distribution, and asynchronous processing. Triggers: "queue storage", "QueueServiceClient", "QueueClient", "message queue", "dequeue".
历史收录数据
| 来源仓库 | microsoft/skills |
|---|---|
| Skill源路径 | .github/plugins/azure-sdk-python/skills/azure-storage-queue-py/SKILL.md |
安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。
