Azure - Blob Storage
在 Azure Blob Storage 容器中上传、下载、列出和删除 blob(文件)。
对容器执行一次 Azure Blob Storage 操作(download、upload、list 或 delete),并将结果放在 result 中返回。存储的瞬时故障会以有上限的指数退避方式重试。
连接你的 Azure 存储账户,自动化文件操作:存储工作流输出、获取待处理的文档、列出容器内容,以及管理 blob 生命周期。
操作:
- Upload: 将内容上传到指定容器中的 blob。
- Download: 按名称下载 blob 内容。
- List: 列出容器中的所有 blob。
- Delete: 按名称删除指定 blob。
工作原理
- 解析节点配置中的表达式。若
connection_id、operation、container、blobName或content为空,worker 会从输入项($json)读取同名字段。operation默认为download。 - 按以下来源构建存储客户端:直接写在
connection_id中的连接字符串(包含DefaultEndpointsProtocol=、AccountName=或UseDevelopmentStorage=true);connection-string类型凭据;或包含accountName与accountKey(或password)的basic-auth/object凭据,此时访问https://<accountName>.blob.core.windows.net。 - 执行操作:
download以字符串读取整个 blob;upload将content写入blobName(覆盖已有内容),返回不含查询字符串的 URL 以及etag、last_modified、request_id、version_id、content_md5;list返回容器内所有 blob 名称;delete删除blobName并返回 SDK 响应。 - 仅对存储调用本身重试(不包括凭据解析),触发条件为网络错误(ETIMEDOUT、ECONNRESET、ECONNREFUSED、ENOTFOUND 等)、HTTP 429、HTTP 5xx 和超时。认证错误及其他 4xx 不重试。
- 成功时经
out返回{ result }。任何失败都以{ error }经error返回;节点不会抛出异常。
在工作流中
节点在工作流文件(draft_nodes[])中的写法,以及一次成功运行的 envelope。
{
"node_id": "node-store-order",
"label": "Store order JSON",
"operator_slug": "integrations.microsoft.azure.blob",
"operator_version": "1.0.0",
"config": {
"connection_id": "pi-credential-xxxx",
"container": "documents",
"operation": "upload",
"blobName": "inbound/{{ $json.order_id }}.json",
"content": "{{ $json.serialized_order }}"
}
}{
"ok": true,
"data": {
"result": {
"url": "https://myaccount.blob.core.windows.net/documents/inbound/ord_123.json",
"blob_name": "inbound/ord_123.json",
"container": "documents",
"etag": "\"0x8DD0E5C2A1B3F00\"",
"last_modified": "2026-11-26T14:03:11.000Z",
"request_id": "5f1c7a2e-001e-0045-2b3c-3e0f8b000000",
"version_id": null,
"content_md5": null
}
},
"port": "out"
}配置
-
connection_idstring 必填 -
Azure Blob Storage 的凭据。接受 `connection-string`(DefaultEndpointsProtocol=...;AccountName=...;AccountKey=...;)或 `basic-auth`(accountName + accountKey)类型的凭据。
-
containerstring 必填 支持表达式 -
要操作的 blob 容器名称。
-
operationstring 必填 -
要执行的存储操作。
-
blobNamestring 可选 支持表达式 -
blob 的路径/名称(例如“reports/2024/summary.pdf”)。
-
contentstring 可选 支持表达式 -
作为 blob 正文上传的内容(字符串或 base64)。
代码中的行为
除 schema 描述之外,实现代码对这些键的实际处理。
-
execution - 未在本节点的 schema 中声明,但会被读取:
retryOnFail: false表示只尝试一次;否则使用maxTries(默认 3),并以waitBetweenTries作为基础退避时间。不做任何设置时,存储调用最多尝试 3 次。 -
http_retry_max_attempts代码会读取,但未声明 - 未声明。设置后覆盖尝试次数,始终限制在 1–5 之间。
-
http_retry_backoff_ms代码会读取,但未声明 - 未声明。基础等待时间(毫秒,默认 1000),每次尝试翻倍,并附加最多 250 毫秒的随机抖动。
-
http_retry_max_wait_ms代码会读取,但未声明 - 未声明。每次等待的上限(默认 20000,最大不超过 30000)。
-
content - 以字符串上传,长度取
content.length,按字符而非字节计数。上传非 ASCII 文本前请先进行 base64 编码。
输出端口
out 默认 操作成功。result 为字符串(download)、包含 blob URL 与元数据的对象(upload)、blob 名称数组(list)或 SDK 删除响应(delete)。
{
"result": {
"url": "https://myaccount.blob.core.windows.net/documents/inbound/ord_123.json",
"blob_name": "inbound/ord_123.json",
"container": "documents",
"etag": "\"0x8DD0E5C2A1B3F00\"",
"last_modified": "2026-11-26T14:03:11.000Z",
"request_id": "5f1c7a2e-001e-0045-2b3c-3e0f8b000000",
"version_id": null,
"content_md5": null
}
}error 校验、凭据解析失败,或存储调用在允许的尝试次数后仍失败。
{
"error": "blobName required for upload"
}在表达式中
后续节点可通过 $("Azure - Blob Storage").item.json.<路径> 读取此节点输出中的内容(请把 Azure - Blob Storage 换成你的节点标签)。Editor 标记工作流编辑器在 Previous Nodes 中提示的路径(输出契约);Worker 标记 worker 实际通过 out 返回的路径,依据“端口”一节所示的输出。
| 表达式 | Editor | Worker |
|---|---|---|
$("Azure - Blob Storage").item.json.resultBlob 操作结果 | ||
$("Azure - Blob Storage").item.json.result.url | — | |
$("Azure - Blob Storage").item.json.result.blob_name | — | |
$("Azure - Blob Storage").item.json.result.container | — | |
$("Azure - Blob Storage").item.json.result.etag | — | |
$("Azure - Blob Storage").item.json.result.last_modified | — | |
$("Azure - Blob Storage").item.json.result.request_id | — | |
$("Azure - Blob Storage").item.json.result.version_id | — | |
$("Azure - Blob Storage").item.json.result.content_md5 | — |
— Worker: worker 会返回它,但编辑器不会提示:请手动输入。对象内部的键可能取决于你的数据或配置(例如每个标签一个键)。
错误
| 消息 | 端口 | 原因与处理 |
|---|---|---|
connection_id is required | error | 配置和输入项中都没有凭据。container is required 同理。 |
blobName required for <operation> | error | upload、download 和 delete 需要 blobName。 |
Unknown operation: <operation> | error | operation 不是 download、upload、list 或 delete。 |
Credential <connection_id> has unsupported type '<type>' for integrations.microsoft.azure.blob. Use 'connection-string' or 'basic-auth'. | error | 该凭据类型无法映射到存储账户。请使用 connection-string 或 basic-auth 凭据。 |
Credential <connection_id> (type '<type>') missing accountName / accountKey | error | 结构化凭据缺少账户名或账户密钥。 |
Cannot read properties of undefined (reading 'length') | error | 执行 upload 时未提供 content。 |
The specified blob does not exist.<…> | error | 对不存在的 blob 执行 download 或 delete 时的 Azure 错误;其他 Azure 错误也按原样传递。 |
输入契约
-
connection_idstring 必填 -
containerstring 必填 -
operationstring 必填 -
blobNamestring 可选 -
contentstring 可选
输出契约
-
resultobject 可选 -
Blob 操作结果
契约(JSON Schema)
与编排器声明完全一致的定义。All 是完整的 *.definition.js;可与上方各节对照,找出文档与 schema 之间的差异。发布前可用它校验节点。
{
"slug": "integrations.microsoft.azure.blob",
"name": "Azure - Blob Storage",
"category": "integrations",
"group": [
{
"key": "microsoft",
"name": "Microsoft",
"icon_url": "/icons/integrations/microsoft/microsoft.svg"
},
{
"key": "azure",
"name": "Azure",
"icon_url": "/icons/integrations/microsoft/azure.svg"
}
],
"icon_url": "/icons/integrations/microsoft/azure-blob.svg",
"version": "1.0.0",
"description": "Upload, download, list, and delete blobs (files) on Azure Blob Storage containers.\n\n Connect your Azure Storage Account and automate file operations — store workflow outputs, retrieve documents for processing, list container contents, and manage blob lifecycle.\n\n **Operations:**\n - **Upload:** Upload content to a blob in the specified container.\n - **Download:** Download a blob's content by name.\n - **List:** List all blobs in a container.\n - **Delete:** Delete a specific blob by name.",
"capabilities": [
"storage",
"azure",
"blob",
"files",
"cloud"
],
"config_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "Azure Storage Credential",
"description": "Credential for Azure Blob Storage. Accepts credentials of type `connection-string` (DefaultEndpointsProtocol=...;AccountName=...;AccountKey=...;) or `basic-auth` (accountName + accountKey).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"connection-string",
"basic-auth"
],
"types": [
"azure.blob",
"azure"
]
}
},
"container": {
"type": "string",
"title": "Container",
"description": "Name of the blob container to operate on.",
"format": "expression"
},
"operation": {
"type": "string",
"title": "Operation",
"enum": [
"download",
"upload",
"list",
"delete"
],
"default": "download",
"description": "The storage operation to perform."
},
"blobName": {
"type": "string",
"title": "Blob Name",
"description": "Path/name of the blob (e.g., \"reports/2024/summary.pdf\").",
"format": "expression",
"displayOptions": {
"show": {
"operation": [
"download",
"upload",
"delete"
]
}
}
},
"content": {
"type": "string",
"title": "Content",
"description": "Content to upload as blob body (string or base64).",
"format": "expression",
"displayOptions": {
"show": {
"operation": [
"upload"
]
}
}
}
},
"required": [
"connection_id",
"container",
"operation"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"container": {
"type": "string"
},
"operation": {
"type": "string"
},
"blobName": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"connection_id",
"container",
"operation"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"result": {
"type": "object",
"description": "Blob operation result"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Result",
"description": "Operation result",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Storage operation failed",
"is_default": false,
"supports_condition": false
}
],
"execution_mode": "async",
"required_resources": [],
"compatible_worker_pools": [
"standard-io",
"cloud-io"
],
"tags": [
"storage",
"cloud",
"azure"
],
"is_stateful": false,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://sommatic.ai",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "Azure Storage Credential",
"description": "Credential for Azure Blob Storage. Accepts credentials of type `connection-string` (DefaultEndpointsProtocol=...;AccountName=...;AccountKey=...;) or `basic-auth` (accountName + accountKey).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"connection-string",
"basic-auth"
],
"types": [
"azure.blob",
"azure"
]
}
},
"container": {
"type": "string",
"title": "Container",
"description": "Name of the blob container to operate on.",
"format": "expression"
},
"operation": {
"type": "string",
"title": "Operation",
"enum": [
"download",
"upload",
"list",
"delete"
],
"default": "download",
"description": "The storage operation to perform."
},
"blobName": {
"type": "string",
"title": "Blob Name",
"description": "Path/name of the blob (e.g., \"reports/2024/summary.pdf\").",
"format": "expression",
"displayOptions": {
"show": {
"operation": [
"download",
"upload",
"delete"
]
}
}
},
"content": {
"type": "string",
"title": "Content",
"description": "Content to upload as blob body (string or base64).",
"format": "expression",
"displayOptions": {
"show": {
"operation": [
"upload"
]
}
}
}
},
"required": [
"connection_id",
"container",
"operation"
]
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"container": {
"type": "string"
},
"operation": {
"type": "string"
},
"blobName": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"connection_id",
"container",
"operation"
]
}{
"type": "object",
"properties": {
"result": {
"type": "object",
"description": "Blob operation result"
}
}
}[
{
"port_id": "out",
"label": "Result",
"description": "Operation result",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Storage operation failed",
"is_default": false,
"supports_condition": false
}
]执行
- 执行方式
async- 有状态
- 否
- 凭据
- 在服务器端根据
connection_id解析,密钥不会进入工作流。 - 能力
storageazureblobfilescloud- 标签
storagecloudazure
说明与限制
- 所有操作都是幂等的,因此重试是安全的:upload 覆盖同名 blob,download 与 list 是读操作,重复 delete 不会造成影响。
- Azure SDK 自带的重试已关闭,worker 的重试策略是唯一的重试层。
download会将 blob 按文本解码,二进制内容无法完整返回。list不支持前缀过滤,会读取容器的全部分页。
已对照编排器代码核实 · 31e874b · 2026-11-26