12
votes

Getting exception "The property value is larger than allowed by the Table Service" while trying to insert a record in azure table storage.

Follwing is my table structure, string PartitionKey,String RowKey,string Id , string site, string name , byte[ ] content,
public DateTime createdtime

And i am trying to save 83755 bytes array ( 82KB ) in content field and other fields are max of 35 chars.

Can anyone please tell me what is the max size of a row for azure storage table?

Following is the url which i referred.. there its mentioned the row can have 1MB max. But mine doesn't exceed 100 KB.

http://blogs.msdn.com/b/jnak/archive/2010/01/06/walkthrough-windows-azure-table-storage-nov-2009-and-later.aspx

Thanks,

Gopinath

3

3 Answers

15
votes

Yes, each row may have up to 1MB. However, each byte array property or string property is limited to 64K. See this MSDN reference for specifics on each data type.

5
votes

I recommend to check out Lokad.Cloud for Azure framework (Open Source). There is a production-tested code for serializing large entities into the table storage with 960KB limit (property splitting and management is handled by the framework)

Here's the sample usage from FatEntities wiki

// TODO: change your connection string here
var providers = Standalone.CreateProviders(
   "DefaultEndpointsProtocol=https;AccountName=;AccountKey=");

// 'books' is the name of the table
var books = new CloudTable<Book>(providers.TableStorage, "books");

var potterBook = new Book 
   { Author = "J. K. Rowling", Title = "Harry Potter" };

var poemsBook = new Book 
   { Author = "John Keats", Title = "Complete Poems" };

// inserting (or updating record in Table Storage)
books.Upsert(new[]
    {
        new CloudEntity<Book> {
            PartitionKey = "UK", RowRey = "potter", Value = potterBook},
        new CloudEntity<Book> {
            PartitionKey = "UK", RowRey = "poems", Value = poemsBook}
    });

// reading from table
foreach(var entity in books.Get())
{
    Console.WriteLine("{0} by {1} in partition '{2}' and rowkey '{3}'",
        entity.Value.Title, entity.Value.Author, 
        entity.PartitionKey, entity.RowRey);
}

Console.WriteLine("Press enter to exit.");
Console.ReadLine();
2
votes

In May 2017, Azure introduced Premium Table which actually utilizes Azure Cosmos DB (formerly called Azure DocumentDB) with Azure Table API.

Premium Table has same 1MB limit for each entity(row), but it allows up to 1MB for single property (no 64K limit).

Moreover, it allows unlimited number of property (Azure Table: 255) and property name length (Azure Table: 255) within dedicated RU. Request Unit is a resource consumption unit for Cosmos DB.

  • Remarks: Premium Table is different from Premium Storage which does not support Table