# Azure - Blob Storage

> Upload, download, list, and delete blobs (files) on Azure Blob Storage containers.

Source: https://docs.sommatic.ai/en/nodes/integrations.microsoft.azure.blob/

- Slug: `integrations.microsoft.azure.blob`
- Family: Integrations
- Version: 1.0.0
- Status: Available
- Execution: async

Upload, download, list, and delete blobs (files) on Azure Blob Storage containers.

Connect your Azure Storage Account and automate file operations — store workflow outputs, retrieve documents for processing, list container contents, and manage blob lifecycle.

**Operations:**
- **Upload:** Upload content to a blob in the specified container.
- **Download:** Download a blob's content by name.
- **List:** List all blobs in a container.
- **Delete:** Delete a specific blob by name.

## Configuration

- `connection_id` (string, required): Credential for Azure Blob Storage. Accepts credentials of type `connection-string` (DefaultEndpointsProtocol=...;AccountName=...;AccountKey=...;) or `basic-auth` (accountName + accountKey).
- `container` (string, required, accepts expressions): Name of the blob container to operate on.
- `operation` (string, required): The storage operation to perform. Default: `download`. Allowed values: `download`, `upload`, `list`, `delete`.
- `blobName` (string, optional, accepts expressions): Path/name of the blob (e.g., "reports/2024/summary.pdf"). Shown when: operation = `download` | `upload` | `delete`.
- `content` (string, optional, accepts expressions): Content to upload as blob body (string or base64). Shown when: operation = `upload`.

## Output ports

- `out` (default): Operation result
- `error`: Storage operation failed

## Input contract

- `connection_id` (string, required)
- `container` (string, required)
- `operation` (string, required)
- `blobName` (string, optional)
- `content` (string, optional)

## Output contract

- `result` (object, optional): Blob operation result

## In expressions

What a later node can read from this node's output with `$("Azure - Blob Storage").item.json.<path>` (write your node's label instead of `Azure - Blob Storage`). **Editor** marks the paths the workflow editor suggests under Previous Nodes (the output contract); **Worker** marks the paths the worker really returns through `out`, from the output shown in Ports.

- `$("Azure - Blob Storage").item.json.result` (object) = `{…}`: Blob operation result
- `$("Azure - Blob Storage").item.json.result.url` (string) = `"https://myaccount.blob.core.windows.net/docu…"` (Not suggested by the editor)
- `$("Azure - Blob Storage").item.json.result.blob_name` (string) = `"inbound/ord_123.json"` (Not suggested by the editor)
- `$("Azure - Blob Storage").item.json.result.container` (string) = `"documents"` (Not suggested by the editor)
- `$("Azure - Blob Storage").item.json.result.etag` (string) = `"\"0x8DD0E5C2A1B3F00\""` (Not suggested by the editor)
- `$("Azure - Blob Storage").item.json.result.last_modified` (string) = `"2026-11-26T14:03:11.000Z"` (Not suggested by the editor)
- `$("Azure - Blob Storage").item.json.result.request_id` (string) = `"5f1c7a2e-001e-0045-2b3c-3e0f8b000000"` (Not suggested by the editor)
- `$("Azure - Blob Storage").item.json.result.version_id` (null) = `null` (Not suggested by the editor)
- `$("Azure - Blob Storage").item.json.result.content_md5` (null) = `null` (Not suggested by the editor)


## How it works

Runs one Azure Blob Storage operation (download, upload, list or delete) on a container and returns the result under `result`. Transient storage failures are retried with bounded exponential backoff.

1. Resolves the expressions of the node config. When `connection_id`, `operation`, `container`, `blobName` or `content` is empty, the worker reads the field of the same name from the incoming item (`$json`). `operation` defaults to `download`.
2. Builds the storage client from: a raw connection string placed in `connection_id` (it contains `DefaultEndpointsProtocol=`, `AccountName=` or `UseDevelopmentStorage=true`); a `connection-string` credential; or a `basic-auth` / `object` credential with `accountName` and `accountKey` (or `password`), which targets `https://<accountName>.blob.core.windows.net`.
3. Runs the operation: `download` reads the whole blob as a string; `upload` writes `content` to `blobName` (overwriting it) and returns its URL without query string, `etag`, `last_modified`, `request_id`, `version_id` and `content_md5`; `list` returns every blob name in the container; `delete` removes `blobName` and returns the SDK response.
4. Retries only the storage call (not credential resolution) on network errors (ETIMEDOUT, ECONNRESET, ECONNREFUSED, ENOTFOUND…), HTTP 429, HTTP 5xx and timeouts. Authentication and other 4xx errors are not retried.
5. Returns `{ result }` on `out`. Any failure is returned as `{ error }` on `error`; the node never throws.

## In a workflow

### Node

```json
{
  "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 }}"
  }
}
```

### Envelope

```json
{
  "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"
}
```

## Output ports (behaviour in the code)

### `out`

The operation succeeded. `result` is a string (`download`), an object with the blob URL and metadata (`upload`), an array of blob names (`list`) or the SDK delete response (`delete`).

```json
{
  "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`

Validation, credential resolution or the storage call failed after the allowed attempts.

```json
{
  "error": "blobName required for upload"
}
```

## Behaviour in the code

- `execution`: Not declared in this node's schema, but read: `retryOnFail: false` means one attempt; otherwise `maxTries` is used (default 3) and `waitBetweenTries` is the base backoff. Without any setting the storage call is tried up to 3 times.
- `http_retry_max_attempts`: Undeclared. When set, it overrides the number of attempts. Always clamped to 1–5.
- `http_retry_backoff_ms`: Undeclared. Base wait in ms (default 1000), doubled on each attempt plus up to 250 ms of random jitter.
- `http_retry_max_wait_ms`: Undeclared. Cap for each wait (default 20000, never more than 30000).
- `content`: Uploaded as a string with `content.length` as its length, counted in characters, not bytes. Encode non-ASCII text as base64 before uploading.

## Errors

| Message | Port | Cause and fix |
| --- | --- | --- |
| `connection_id is required` | `error` | No credential in the config or in the incoming item. `container is required` works the same way. |
| `blobName required for <operation>` | `error` | `upload`, `download` and `delete` need `blobName`. |
| `Unknown operation: <operation>` | `error` | `operation` is not download, upload, list or delete. |
| `Credential <connection_id> has unsupported type '<type>' for integrations.microsoft.azure.blob. Use 'connection-string' or 'basic-auth'.` | `error` | The credential type cannot be mapped to a storage account. Use a `connection-string` or `basic-auth` credential. |
| `Credential <connection_id> (type '<type>') missing accountName / accountKey` | `error` | A structured credential lacks the account name or key. |
| `Cannot read properties of undefined (reading 'length')` | `error` | `upload` was run without `content`. |
| `The specified blob does not exist.<…>` | `error` | Azure error for `download` or `delete` on a missing blob; other Azure errors are passed through the same way. |

## Notes and limits

- Retries are safe because every operation is idempotent: upload overwrites the same name, download and list are reads, and repeating a delete is harmless.
- The Azure SDK's own retries are disabled; the worker's policy is the only retry layer.
- `download` decodes the blob as text, so binary content is not returned intact. `list` has no prefix filter and reads every page of the container.


## Contracts (JSON Schema)

### All (`*.definition.js`)

```json
{
  "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
    }
  }
}
```

### config_schema

```json
{
  "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

```json
{
  "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

```json
{
  "type": "object",
  "properties": {
    "result": {
      "type": "object",
      "description": "Blob operation result"
    }
  }
}
```

### ports

```json
[
  {
    "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
  }
]
```
