Azure StorageException when using emulated storage (within documented limits)

Our application performs several batches TableBatchOperation. We guarantee that each of these batch table operations has

  • 100 or fewer table operations
  • table operations for only one section of a section

In the lines of the following:

        foreach (var batch in batches)
        {
            var operation = new TableBatchOperation();
            operation.AddRange(batch.Select(x => TableOperation.InsertOrReplace(x)));
            await table.ExecuteBatchAsync(operation);
        }
  • When we use the emulated storage, we click Microsoft.WindowsAzure.Storage.StorageException- "Item 99 in the packet returns an unexpected response code."
  • When we use Azure products, everything works fine.

The emulated storage is configured as follows:

<add key="StorageConnectionString" value="UseDevelopmentStorage=true;" />

, , ( Azure), , , , -, .

( ) , ( API):

  • 492093 JSON (984186 UTF-16)
  • 100

. https://docs.microsoft.com/en-us/dotnet/api/microsoft.windowsazure.storage.table.tablebatchoperation?view=azurestorage-8.1.3

EDIT: , (# 71/100) . , - , /?

EDIT: Unicode UTF-16 ( string) , :

r     e     n     U+0019         space
114 0 101 0 110 0 25 0 115 0 32 0

( 25 0 115 0, unicode end-of-medium U + 0019, ).

EDIT: :

JSON:

{"SomeProperty":"ren\u0019s ","PartitionKey":"SomePartitionKey","RowKey":"SomeRowKey","Timestamp":"0001-01-01T00:00:00+00:00","ETag":null}

:

public class TestEntity : TableEntity
{
    public string SomeProperty { get; set; }
}

Entity:

var entity = new TestEntity
{
    SomeProperty = Encoding.Unicode.GetString(new byte[]
        {114, 0, 101, 0, 110, 0, 25, 0, 115, 0, 32, 0}),
    PartitionKey = "SomePartitionKey",
    RowKey = "SomeRowKey"
};
+4
1

, . , Unicode Character ' END OF MEDIUM' (U + 0019), , Azure Storage Emulator. , .

feedback Azure.

0

Source: https://habr.com/ru/post/1680095/


All Articles