Reputation: 10215
I'm getting started with Table Storage. I have the emulator (v4.0.0.0) working and can successfully create tables through code (i think I'm using v2.6 of the client libraries). But I can't seem to insert entities.
According to this article From 2010 (Azure Table Storage, what a pain in the ass) I need to insert a dummy entity when using a table for the first time (applies to the emulator only).
Do I still need to do this for the storage emulator v4.0.0.0? The code provided in the article also uses members which have been depreciated so I'd rather not use them if possible.
Update - I was unable to successfully call results = table.ExecuteBatch(b);
which failed on the first entity, where as result = table.Execute(b[0]);
appears to work. Looks like I need to do some more digging.
Update - This is the error information I'm getting through the exception:
Error message: "Unexpected response code for operation : 0"
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(List
1 list) in c:\...\AzureStorageDataProvider.cs:line 61"Upvotes: 0
Views: 157
Reputation: 3802
As also documented in our Performing Entity Group Transactions article, entity group transactions (batch) cannot contain more than 100 entities. The error message should definitely be more clear, so I will file that as a bug, but reducing the number of entities to <=100 should prevent the error you are seeing.
Upvotes: 3