"The request body is too large and exceeds the maximum permissible limit" 将块 blob 上传到 Azure 时

"The request body is too large and exceeds the maximum permissible limit" when uploading block blob to Azure

我正在尝试将 300GB 的文件上传到 Azure Blob 存储。下面是我正在使用的代码:

// content = array of bytes ~ 300 GB
using (var stream = new MemoryStream(content))
{
      var blobRequestOptions = new BlobRequestOptions
      {
          ParallelOperationThreadCount = Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.MaxParallelOperationThreadCount
      };
      blob.UploadFromStream(stream, options: blobRequestOptions);
}

此操作失败并出现以下消息错误:

The request body is too large and exceeds the maximum permissible limit

我认为问题(根据确认旧 SDK 版本的评论)是客户端 SDK 版本号。从 v8.0 开始,支持大(200GB -> 4.77TB)块 blob 大小(块现在最大为 100MB,而旧的限制为 4MB)。 50,000 个块的限制仍然适用(因此,100MB x 50,000 个块提供 4.77TB 大小)。

之前的 SDK 版本限制为 4MB 块和 200GB 块 blob 大小限制。

Larger Block Blobs are supported by the most recent releases of the .NET Client Library (version 8.0.0), the Java Client Library (version 5.0.0), the Node.js Client Library (version 2.0.0) and the AzCopy Command-Line Utility (version 5.2.0). You can also directly use the REST API as always. Larger Block Blobs are supported by REST API version 2016-05-31 and later.

更多信息here