适用于 Azure Functions 的 Azure Blob 存储绑定概述Azure Blob storage bindings for Azure Functions overview

Azure Functions 通过触发器和绑定Azure 存储集成。Azure Functions integrates with Azure Storage via triggers and bindings. 与 Blob 存储集成即可构建函数,用于响应 blob 数据中的更改以及读取和写入值。Integrating with Blob storage allows you to build functions that react to changes in blob data as well as read and write values.

操作Action 类型Type
在 blob 存储数据更改时运行函数Run a function as blob storage data changes 触发器Trigger
在函数中读取 blob 存储数据Read blob storage data in a function 输入绑定Input binding
允许函数写入 blob 存储数据Allow a function to write blob storage data 输出绑定Output binding

添加到 Functions 应用Add to your Functions app

Functions 2.x 及更高版本Functions 2.x and higher

使用触发器和绑定需要引用相应的包。Working with the trigger and bindings requires that you reference the appropriate package. NuGet 包用于 .NET 类库,而扩展捆绑包用于其他所有应用程序类型。The NuGet package is used for .NET class libraries while the extension bundle is used for all other application types.

语言Language 添加方式...Add by... 备注Remarks
C#C# 安装 NuGet 包版本 3.xInstalling the NuGet package, version 3.x
C# 脚本、Java、JavaScript、PowerShellC# Script, Java, JavaScript, PowerShell 注册扩展捆绑包Registering the extension bundle 建议将 Azure Tools 扩展用于 Visual Studio Code。The Azure Tools extension is recommended to use with Visual Studio Code.
C# 脚本(Azure 门户中仅限联机)C# Script (online-only in Azure portal) 添加绑定Adding a binding 若要更新现有绑定扩展而不必重新发布函数应用,请参阅更新扩展To update existing binding extensions without having to republish your function app, see Update your extensions.

Functions 1.xFunctions 1.x

Functions 1.x 应用会自动引用 Microsoft.Azure.WebJobs NuGet 程序包(版本 2.x)。Functions 1.x apps automatically have a reference the Microsoft.Azure.WebJobs NuGet package, version 2.x.

Functions 1.x 中的 Azure 存储 SDK 版本Azure Storage SDK version in Functions 1.x

在 Functions 1.x 中,存储触发器和绑定使用 7.2.1 版的 Azure 存储 SDK(WindowsAzure.Storage NuGet 包)。In Functions 1.x, the Storage triggers and bindings use version 7.2.1 of the Azure Storage SDK (WindowsAzure.Storage NuGet package). 如果引用另一版本的存储 SDK,而且在函数签名中绑定到某个存储 SDK 类型,则 Functions 运行时可能会报告它不能绑定到该类型。If you reference a different version of the Storage SDK, and you bind to a Storage SDK type in your function signature, the Functions runtime may report that it can't bind to that type. 此解决方案是为了确保项目引用 WindowsAzure.Storage 7.2.1The solution is to make sure your project references WindowsAzure.Storage 7.2.1.

后续步骤Next steps