本页内容
Sommatic 文档
打开控制台

Azure - Blob Storage

在 Azure Blob Storage 容器中上传、下载、列出和删除 blob(文件)。

以 Markdown 查看
在以下应用中打开
集成 可用 integrations.microsoft.azure.blob 版本 1.0.0 执行方式: async

对容器执行一次 Azure Blob Storage 操作(download、upload、list 或 delete),并将结果放在 result 中返回。存储的瞬时故障会以有上限的指数退避方式重试。

连接你的 Azure 存储账户,自动化文件操作:存储工作流输出、获取待处理的文档、列出容器内容,以及管理 blob 生命周期。

操作:

  • Upload: 将内容上传到指定容器中的 blob。
  • Download: 按名称下载 blob 内容。
  • List: 列出容器中的所有 blob。
  • Delete: 按名称删除指定 blob。

工作原理

  1. 解析节点配置中的表达式。若 connection_id、operation、container、blobName 或 content 为空,worker 会从输入项($json)读取同名字段。operation 默认为 download。
  2. 按以下来源构建存储客户端:直接写在 connection_id 中的连接字符串(包含 DefaultEndpointsProtocol=、AccountName= 或 UseDevelopmentStorage=true);connection-string 类型凭据;或包含 accountName 与 accountKey(或 password)的 basic-auth / object 凭据,此时访问 https://<accountName>.blob.core.windows.net。
  3. 执行操作:download 以字符串读取整个 blob;upload 将 content 写入 blobName(覆盖已有内容),返回不含查询字符串的 URL 以及 etag、last_modified、request_id、version_id、content_md5;list 返回容器内所有 blob 名称;delete 删除 blobName 并返回 SDK 响应。
  4. 仅对存储调用本身重试(不包括凭据解析),触发条件为网络错误(ETIMEDOUT、ECONNRESET、ECONNREFUSED、ENOTFOUND 等)、HTTP 429、HTTP 5xx 和超时。认证错误及其他 4xx 不重试。
  5. 成功时经 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 }}"
  }
}

配置

connection_id string 必填

Azure Blob Storage 的凭据。接受 `connection-string`(DefaultEndpointsProtocol=...;AccountName=...;AccountKey=...;)或 `basic-auth`(accountName + accountKey)类型的凭据。

container string 必填 支持表达式

要操作的 blob 容器名称。

operation string 必填

要执行的存储操作。

默认值: download

可选值: downloaduploadlistdelete

blobName string 可选 支持表达式

blob 的路径/名称(例如“reports/2024/summary.pdf”)。

显示条件: operation = download | upload | delete

content string 可选 支持表达式

作为 blob 正文上传的内容(字符串或 base64)。

显示条件: operation = upload

代码中的行为

除 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 返回的路径,依据“端口”一节所示的输出。

表达式EditorWorker
$("Azure - Blob Storage").item.json.resultobject= {…}Blob 操作结果
$("Azure - Blob Storage").item.json.result.urlstring编辑器不提示= "https://myaccount.blob.core.windows.net/docu…"—
$("Azure - Blob Storage").item.json.result.blob_namestring编辑器不提示= "inbound/ord_123.json"—
$("Azure - Blob Storage").item.json.result.containerstring编辑器不提示= "documents"—
$("Azure - Blob Storage").item.json.result.etagstring编辑器不提示= "\"0x8DD0E5C2A1B3F00\""—
$("Azure - Blob Storage").item.json.result.last_modifiedstring编辑器不提示= "2026-11-26T14:03:11.000Z"—
$("Azure - Blob Storage").item.json.result.request_idstring编辑器不提示= "5f1c7a2e-001e-0045-2b3c-3e0f8b000000"—
$("Azure - Blob Storage").item.json.result.version_idnull编辑器不提示= null—
$("Azure - Blob Storage").item.json.result.content_md5null编辑器不提示= null—

— 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_id string 必填
container string 必填
operation string 必填
blobName string 可选
content string 可选

输出契约

result object 可选

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
    }
  }
}

执行

执行方式
async
有状态
否
凭据
在服务器端根据 connection_id 解析,密钥不会进入工作流。
能力
storageazureblobfilescloud
标签
storagecloudazure

说明与限制

  • 所有操作都是幂等的,因此重试是安全的:upload 覆盖同名 blob,download 与 list 是读操作,重复 delete 不会造成影响。
  • Azure SDK 自带的重试已关闭,worker 的重试策略是唯一的重试层。
  • download 会将 blob 按文本解码,二进制内容无法完整返回。list 不支持前缀过滤,会读取容器的全部分页。

已对照编排器代码核实 · 31e874b · 2026-11-26

安装智能体工具

为你的编程智能体接入 Sommatic AI 官方文档:技能包、文档 MCP 服务器与 Markdown 页面,无需再抓取网页。

安装 Sommatic AI CLI,并为检测到的智能体配置合适的插件。

npx @sommatic/cli agent setup
智能体如何读取本文档