Azure Functions 的 Azure 表存储绑定Azure Table storage bindings for Azure Functions

Azure Functions 通过触发器和绑定Azure 存储集成。Azure Functions integrates with Azure Storage via triggers and bindings. 与表存储集成后,你可以生成读取和写入表存储数据的函数。Integrating with Table storage allows you to build functions that read and write Table storage data.

操作Action 类型Type
在函数中读取表存储数据Read table storage data in a function 输入绑定Input binding
允许函数写入表存储数据Allow a function to write table storage data 输出绑定Output binding

包 - Functions 2.x 及更高版本Packages - Functions 2.x and higher

Microsoft.Azure.WebJobs.Extensions.Storage NuGet 包 3.x 版中提供了表存储绑定。The Table storage bindings are provided in the Microsoft.Azure.WebJobs.Extensions.Storage NuGet package, version 3.x. azure-webjobs-sdk GitHub 存储库中提供了此包的源代码。Source code for the package is in the azure-webjobs-sdk GitHub repository.

使用以下方法在首选开发环境中添加支持。Add support in you preferred development environment using the following methods.

开发环境Development environment 应用程序类型Application type 添加支持To add support
Visual StudioVisual Studio C# 类库C# class library 安装 NuGet 包Install the NuGet package
Visual Studio CodeVisual Studio Code 基于核心工具Based on core tools 注册扩展捆绑包Register the extension bundle

建议安装 Azure Tools 扩展Installing the Azure Tools extension is recommended.
任何其他编辑器/IDEAny other editor/IDE 基于核心工具Based on core tools 注册扩展捆绑包Register the extension bundle
Azure 门户Azure Portal 仅在门户中联机Online only in portal 在添加绑定时安装Installs when adding a binding

请参阅更新扩展以更新现有绑定扩展,而无需重新发布函数应用。See Update your extensions to update existing binding extensions without having to republish your function app.

包 - Functions 1.xPackages - Functions 1.x

Microsoft.Azure.WebJobs NuGet 包 2.x 版中提供了表存储绑定。The Table storage bindings are provided in the Microsoft.Azure.WebJobs NuGet package, version 2.x. azure-webjobs-sdk GitHub 存储库中提供了此包的源代码。Source code for the package is in the azure-webjobs-sdk GitHub repository.

C# 类库C# class library

对于 C# 类库开发,自动在项目中安装该包。For C# class library development, the package is automatically installed in the project.

Functions 2.x 中的绑定扩展Binding extensions in Functions 2.x

对于 Azure Functions 2.x 版中的本地开发,该包自动注册为绑定扩展For local development in Azure Functions version 2.x, the package is automatically registered as a binding extension.

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