How to upload large file to blob storage using SAS URL?

Stanley Yau 10 Reputation points
2024-07-22T23:41:14.89+00:00

Uploading a 8G object via SAS URL fails with HTTP 413.

<Error>
    <Code>RequestBodyTooLarge</Code>
    <Message>The request body is too large and exceeds the maximum permissible limit.
RequestId:....
Time:2024-07-19T17:27:36.7801211Z</Message>
    <MaxLimit>5242880000</MaxLimit>
</Error>

Various Azure document indicates that the limit is 4MB. However, the 413 response indicates 5G. 

There was a post in 2013 about splitting and uploading chunks with the same Sas URL. To upload each chunk, append &comp=block&blocckid=xxxxxx
Is this a legitimate solution? Is there a sample solution?
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Silvia Wibowo 6,071 Reputation points Microsoft Employee Volunteer Moderator
    2025-06-02T23:56:34.1066667+00:00

    Hi @Stanley Yau , I understand that you're trying to upload a large file (8GB) into Azure Storage Blob using SAS URL. It failed with "RequestBodyTooLarge" error.

    Azure Blob Storage Maximum Blob Size lists out maximum blob size via single write operation (via Put Blob) = 5000 MiB if you're using Version 2019-12-12 and later. It's consistent with your observation: "the 413 response indicates 5G".

    By default (if you don't specify blob type or if you create from Azure Portal), Azure Storage Account will have containers with block blob type. To upload a large file more than 5GB, write a set of blocks via the Put Block operation and then commit the blocks to a blob with the Put Block List operation.

    Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.