Microsoft Azure Community Forums

Storage - Blob Storage

Issue with Large Blob Uploads using .NET SDK

U

Hello everyone,

I'm encountering an issue when trying to upload large files (around 5GB) to Azure Blob Storage using the latest .NET SDK (v12.13.0). The uploads seem to fail intermittently, and I'm not getting clear error messages. Sometimes the upload completes, but the blob is corrupted. I've tried using both UploadFromFileAsync and block blob uploading manually, but the problem persists.

Has anyone else experienced similar problems? Any tips on how to troubleshoot this or best practices for uploading very large blobs?

Thanks in advance!

Reply Like (5) Report
A

Hi User123,

Thanks for reaching out. We recommend using the TransferManager class for large file uploads, as it handles chunking, retries, and parallel uploads automatically. Ensure you have the latest SDK version installed and that your network connection is stable.

Could you please check the diagnostic logs on your application? The SDK often provides more detailed information there. Also, consider setting a higher timeout for your blob client operations.

Example using TransferManager:


// Assuming you have initialized BlobServiceClient and BlobContainerClient
var blobClient = containerClient.GetBlobClient("your-blob-name.dat");
var transferOptions = new UploadTransferOptions
{
    MaximumConcurrency = 8, // Adjust based on your network and CPU
    UploadSizeConcurrency = 4 // Number of concurrent uploads for chunks
};
await blobClient.UploadFromFileAsync("path/to/your/large/file.dat", transferOptions: transferOptions);
                    

Let us know if this helps.

Reply Like (3) Report
U

Thanks, AzureSupport! I'll try out the TransferManager with the specified options. I'll also dive into the diagnostic logs to see if I can find more clues. My timeouts are currently quite low, so increasing those might be a good idea too.

Will update this thread with my findings.

Reply Like (1) Report

Post a Reply