我有包含 byte[]
属性的 tableEntity
[StorageTableName("TestTable")]
public class TestTableEntity : TableEntity
{
public byte[] Data { get; set; }
}
在此属性中,我想将一些文件转换为字节(如果不正确 - 请建议其他解决方案)。
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..
因为数组真的很大。
有什么办法可以解决这个问题吗?
最佳答案
在 Azure 表存储中,实体的最大存储容量约为 1 MB ( Azure Storage Scalability and Performance Targets )。
检查数据是否超出指定限制,在这种情况下您可能需要将数据存储在 Azure Blob 中并在表中添加对其的引用或直接使用它。
关于c# - 如何将巨大的字节数组保存到azure表存储中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45696848/