azure - 使用 CloudTable 绑定(bind)到 v2 Azure Functions 中的表存储

标签 azure azure-storage azure-functions

所以根据this issue on GitHub ,v2 Azure Functions 不再支持 IQueryable。这也体现在 the official docs 。该文档还提到 CloudTable 可用于绑定(bind)到表存储,但没有提供具体信息或示例。 在一个最小的工作示例中,v2 Azure Functions 的表存储绑定(bind)是什么样子的(例如,从表存储中读取表的所有行)? 非常感谢任何帮助!

最佳答案

应该很简单

[FunctionName("TestFunction")]
public static async Task Run(
    [QueueTrigger("test-queue")] string message,
    [Table("testTable")] CloudTable testTable)
{
    var querySegment = testTable.ExecuteQuerySegmentedAsync(new TableQuery<ResultEntity>(), null);
    foreach (ResultEntity item in querySegment.Result)
    {
        // Access table storage items here
    }
}

提供完整的工作示例 here .

关于azure - 使用 CloudTable 绑定(bind)到 v2 Azure Functions 中的表存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48922485/

相关文章:

azure - 如何向 Azure shell 提供密码?

azure - 如何在 Azure 中使用事件网格触发 C++ 代码?

azure - 如何通过代码配置Azure Function身份验证?

sql - 我们可以将本地 SQL Server 数据库中的表连接到 Azure Delta Lake 中 Delta 表中的表吗?我有什么选择

.net - 使用 Azure 应用服务和/或通知中心向多个应用发送推送通知

azure - 查找DataDisk资源与Windows Server卷的映射关系

c# - 以编程方式创建 Blob 存储容器

C# Azure Function App 部署时的行为有所不同

azure - 批处理错误异常 : The specified operation is not valid for the current state of the resource

Azure 表存储升级