@azure/functions-extensions-blob

中文文档
0.3.0发布于 2026/04/09MITTypeScriptESM + CJS近 30 天下载 2857

Node.js Azure Storage Client extension implementations for Azure Functions

原始使用文档
文档目录8 节
  1. Azure Functions Node.js Extensions - Blob
  2. Features
  3. Prerequisites
  4. Installation
  5. Usage
  6. Contributing
  7. License
  8. Resources

Azure Functions Node.js Extensions - Blob

This project provides extensions for working with Azure Blob Storage in Azure Functions using Node.js. It simplifies the integration and interaction with Blob Storage, enabling developers to build scalable and efficient serverless applications.

Features

  • Blob Trigger: Automatically trigger Azure Functions when a blob is created or updated in a specified container.
  • Blob Input Binding: Read blob content as input to your function.
  • Cached Client Management: Optimized client reuse with intelligent caching
  • Resource Management: Proper disposal patterns for Azure resource clients
  • Performance Optimizations: Reduced overhead for blob operations

Prerequisites

Installation

To install the required dependencies, run:

npm install @azure/functions-extensions-blob

Usage

  1. Set up your Azure Blob Storage account:

    • Create a storage account in the Azure portal.
    • Create a container within the storage account.
  2. Configure your function:

    • Update the function.json file to include the appropriate bindings for Blob Storage.
  3. Import and initialize the extension:

import '@azure/functions-extensions-blob'; // Ensures at the top of the file

Using in Azure Functions

import "@azure/functions-extensions-blob"; // Ensures side effects run
import { StorageBlobClient } from "@azure/functions-extensions-blob";
import { app, InvocationContext } from "@azure/functions";

export async function storageBlobTrigger1(
  blobStorageClient: StorageBlobClient,
  context: InvocationContext
): Promise<void> {
  context.log(
    `Storage blob function processed blob "${context.triggerMetadata.name}"`
  );
  try {
     // Use the cached client for better performance
    const downloadBlockBlobResponse =
      await blobStorageClient.blobClient.download();
// Additional operations...

  }
}

app.storageBlob("storageBlobTrigger1", {
  path: "snippets/SomeFolder/{name}",
  connection: "AzureWebJobsStorage",
  sdkBinding: true, //Ensure this is set to true
  handler: storageBlobTrigger1,
});


  1. Run locally:
  • Use the Azure Functions Core Tools to run your function locally: bash func start
  1. Deploy to Azure:
  • Deploy your function to Azure using the following command: bash func azure functionapp publish <YourFunctionAppName>

Contributing

Contributions are welcome! Please follow the contribution guidelines when submitting issues or pull requests.

License

This project is licensed under the MIT License.

Resources

版本与发布记录

@azure/functions-extensions-blob 共发布 3 个版本,首次发布于 2025/05/15;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.3.0latest2026/04/096 个月前
0.2.0-preview2025/08/021.3 年前
0.1.0-preview2025/05/151.5 年前

关于 @azure/functions-extensions-blob 的常见问题

@azure/functions-extensions-blob 是什么?

Node.js Azure Storage Client extension implementations for Azure Functions

如何安装 @azure/functions-extensions-blob?

在项目目录运行 npm install @azure/functions-extensions-blob,或使用 pnpm add / yarn add / bun add。

@azure/functions-extensions-blob 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@azure/functions-extensions-blob 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@azure/functions-extensions-blob 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@azure/functions-extensions-blob 可以商用吗?

@azure/functions-extensions-blob 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@azure/functions-extensions-blob 的下载量有多少?

根据 npm 官方下载统计,@azure/functions-extensions-blob 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,857 次,日均约 95 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@azure/functions-extensions-blob 还在维护吗?

最新版本 0.3.0 发布于 2026/04/09(6 个月前);至今共发布 3 个版本,其中过去 12 个月发布了 1 个;首次发布于 2025/05/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。