【发布时间】:2015-06-30 23:39:41
【问题描述】:
我开始使用表存储。我有模拟器(v4.0.0.0)工作并且可以通过代码成功创建表(我想我正在使用客户端库的v2.6)。但我似乎无法插入实体。
根据这篇文章 From 2010 (Azure Table Storage, what a pain in the ass) 我需要在第一次使用表格时插入一个虚拟实体(仅适用于模拟器)。
我还需要为存储模拟器 v4.0.0.0 执行此操作吗?文章中提供的代码也使用了已经折旧的成员,所以如果可能的话我宁愿不使用它们。
更新 - 我无法成功调用results = table.ExecuteBatch(b);,它在第一个实体上失败,而result = table.Execute(b[0]); 似乎可以工作。看来我需要做更多的挖掘工作。
更新 - 这是我通过异常得到的错误信息:
错误消息:“操作的意外响应代码:0”
- RequestInformation.HttpStatusCode: 400
- RequestInformation.ExtendedErrorInformation.ErrorCode:“无效输入”
- RequestInformation.ExtendedErrorInformation.ErrorMessage "0: 请求输入之一无效。RequestId:6d740e0e-f013-4d29-a712-2942115e8e4d\nTime:2015-06-29T20:28:05.5784120Z"
- Stacktrace (snipped): "在 Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand
1 cmd, IRetryPolicy policy, OperationContext operationContext)\r\n at Microsoft.WindowsAzure.Storage.Table.TableBatchOperation.Execute(CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext)\r\n at Microsoft.WindowsAzure.Storage.Table.CloudTable.ExecuteBatch(TableBatchOperation batch, TableRequestOptions requestOptions, OperationContext operationContext)\r\n at Morphological.FinanceTracker.AzureDataProvider.AzureStorageDataProvider.SaveTransactionsToAzure(List1 list) in c:\...\AzureStorageDataProvider.cs:line 61"
【问题讨论】:
-
调用ExecuteBatch时出现什么错误?
-
嗨@SerdarOzler-Microsoft - 问题已更新以包含该内容。
-
能否请您检查一下您在批处理中有多少个操作
b? -
批次不能包含超过 100 个实体。我也将此作为答案发布。
标签: azure-table-storage azure-emulator