【问题标题】:Query Azure Table Storage with Rest Api使用 Rest Api 查询 Azure 表存储
【发布时间】:2020-11-20 12:53:13
【问题描述】:

我正在尝试使用其余 api 从 azure 数据表中检索数据。Url 看起来像这样。

https://<service-url>/Customers(PartitionKey='MyPartition')

无效数据导致 Api 错误。

如果我添加 RowKey 以及 PartitionKey 类似的东西。它有效。

https://<service-url>/Customers(PartitionKey='MyPartition',RowKey='MyRowKey1')

是否需要传递RowKey?

如果我只想从一个分区中检索所有数据怎么办。 我知道,我们可以在查询参数中添加一个 $filter 但这不会导致性能问题吗?

请分享你的想法。

谢谢!

【问题讨论】:

    标签: azure azure-table-storage azure-tablequery


    【解决方案1】:

    是的,当使用这种格式https://&lt;service-url&gt;/Customers(xxx) 时,您需要同时指定PartitionKeyRowKey

    在查询中使用$filter 时,根据我的测试(大约100 条记录),耗时没有更多差异。而且我也尝试使用SDK查询,只需要指定PartitionKey,我可以看到它在后端自动使用$filter(通过使用工具Fiddler)。

    【讨论】:

      猜你喜欢
      • 2020-07-27
      • 1970-01-01
      • 1970-01-01
      • 2011-08-01
      • 2016-12-02
      • 1970-01-01
      • 2018-12-06
      • 2010-11-14
      • 2020-04-07
      相关资源
      最近更新 更多