demo
demo

Reputation: 6235

How to save huge byte array into azure table storage?

I have tableEntity that contains byte[] property

[StorageTableName("TestTable")]
public class TestTableEntity : TableEntity
{
    public byte[] Data { get; set; }
}

In this property I want to put some file converted into bytes (if it is incorrect - please suggest another solution).

var table = tableStorage.Table<TestTableEntity>();
await table.CreateIfNotExistsAsync();

var entity = new TestTableEntity 
{
    Data = data, //byte[]
    PartitionKey = partitionKey, //date
    RowKey = schemaName// string
};

await table.InsertOrUpdateAsync(entity);

At step of insert I get error

The remote server returned an error: (413) The request body is too large and exceeds the maximum permissible limit..

Cause array is really huge.

Is there any ways how to resolve this?

Upvotes: 0

Views: 1888

Answers (1)

Chirag Rupani
Chirag Rupani

Reputation: 1715

In Azure table storage, maximum storage capacity of entity is about 1 MB (Azure Storage Scalability and Performance Targets).

Check if data exceeds the specified limit, in that case you might need to store data in the Azure Blob and add reference to it in the table or directly using it.

Upvotes: 6

Related Questions