At times you would get errors such as below while executing batch transactions on a table in table storage
Microsoft.WindowsAzure.Storage.StorageException: Unexpected response code for operation : 5 at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](StorageCommandBase`1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Table.CloudTable.ExecuteBatch(TableBatchOperation batch, TableRequestOptions requestOptions, OperationContext operationContext) at Worker.Processors.QueueOneProcessor.FlushCache() Request Information RequestID:fe0a42c7-faeb-4fd7-a9f8-690bc12e1f41 RequestDate:Tue, 21 May 2013 13:48:55 GMT StatusMessage:Accepted ErrorCode:OutOfRangeInput
One of the most common reason of such failure is malformed parameters passed in the query such as using disallowed characters in partitionkey or rowkey. The reason for the error above is that partitionkey contained a disallowed character "?". Refer to http://msdn.microsoft.com/en-us/library/dd179338.aspx which specifies below
Characters Disallowed in Key FieldsThe following characters are not allowed in values for the PartitionKey and RowKey properties:
• The forward slash (/) character • The backslash (\) character • The number sign (#) character • The question mark (?) character
If you are getting the aforementioned error then please check if the partitionkey or rowkey being passed contains a disallowed character and rectify it.
wish the exception was better. eg "the character '/' is not allowed in a rowkey"
I think the reason I saw a similar error was that I was trying to update the same row twice in 1 batch. Fixing the code so each row is only updated once per batch resolved the error.
"In my scenario I had a null value pushed into a DateTime property"
Thank you! This is much more helpful than "Unexpected response code" error it gives back.