How do I use HTTP Chunked file transfers to/from Azure.Storage?

1.7k Views Asked by At

I'm interested in adding a security front end to AzureStorage for authentication, access control, excessive usage (rate limiter), and other features.

I've read repos on Github regarding ASP.NET Core (I'm at 5.0), however during this research I came across many issues regarding HTTP CHUNKED, and do want broad browser support (Desktop and mobile) to simply GET the ASP.NET Core protected front end, and then use that CHUNKED verb to resume downloading from Azure Storage.

How can I use ASP.NET Core to support this feature in supported Web Browsers using Blob or other implementations of Azure Disk?

1

There are 1 best solutions below

0
On

I'll provide links to docs and example you can use as a reference. If I understand correctly, you want to look at the BlockBlobClient class if you're wanting to upload data in chunks.

Here's a link to the API reference for HTTP level requests. Specifically it's the Put Block request, which is what gets called when doing one of these chunked uploads through the client. You mentioned HTTP CHUNKED, I assume you're referring to the Transfer Encoding : Chunked header and the transfer mechanism? It looks like HTTP/1.1 is the supported version for the Azure Blob Storage API.

I'm not entirely clear on your concerns but I know chunked transfers are not supported in HTTP/2. Not sure what you would do about that until the service is updated at some point in the future. You said you were building a front-end, which I assume is likely a JavaScript based application of some sort? If so, you can use the Blob Storage JavaScript client library. Obviously if you're uploading from inside ASP.NET, then use the C# package.

HTTP API Reference : https://learn.microsoft.com/en-us/rest/api/storageservices/put-block

Example : Upload video in chunks Azure blob storage

Docs : https://learn.microsoft.com/en-us/dotnet/api/azure.storage.blobs.specialized.blockblobclient?view=azure-dotnet