2017-08-15 44 views
0

我有一个包含byte[]财产如何将大型字节数组保存到天蓝色表格存储中?

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

在这个属性我希望把转换成字节的一些文件tableEntity(如果它是不正确 - 请提出另一种解决方案)。

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); 

在插入的一步,我得到错误

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

原因阵列确实非常大。

有什么办法可以解决这个问题吗?

+0

大块上传......可能将它们作为块存储在表中,因此更容易检索它们 –

+0

@MichaelCoxon,任何链接如何做到这一点?就像这里https://stackoverflow.com/a/18170921/3917754 – demo

+3

为什么不使用blob存储呢? –

回答

5

在Azure表存储中,实体的最大存储容量大约为1 MB(Azure Storage Scalability and Performance Targets)。

检查数据是否超出指定限制,在这种情况下,您可能需要将数据存储在Azure Blob中,并在表中添加引用或直接使用它。

+1

此外,[字节数组列的最大大小只有64k](https://docs.microsoft.com/en-us/rest/api/storageservices/understanding-the-table-service-data-model)。 –

相关问题