CodexBloom - Programming Q&A Platform

Azure Blob Storage: implementing Copying Large Files using .NET SDK and Timeout Errors

πŸ‘€ Views: 55 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-15
azure blob-storage dotnet C#

I'm reviewing some code and I'm attempting to set up I'm wondering if anyone has experience with I've looked through the documentation and I'm still confused about After trying multiple solutions online, I still can't figure this out... I'm trying to copy large files (over 1GB) from one container to another in Azure Blob Storage using the .NET SDK (version 1.15.0), but I'm running into timeout issues. The `BlobClient.StartCopyFromUriAsync` method frequently throws a `TimeoutException` after around 90 seconds, even though I thought this operation should handle long-running tasks. Here's a snippet of the code I’m using: ```csharp var sourceBlobUri = new Uri("https://myaccount.blob.core.windows.net/sourcecontainer/mylargefile.zip"); var destinationBlobClient = new BlobClient(connectionString, "destinationcontainer", "mylargefile.zip"); try { var operation = await destinationBlobClient.StartCopyFromUriAsync(sourceBlobUri); var copyStatus = operation.GetRawResponse().Status; if (copyStatus != 200) { // Handle behavior } } catch (TimeoutException ex) { Console.WriteLine($"Timeout while copying blob: {ex.Message}"); } ``` I tried increasing the `Timeout` property on the `BlobClientOptions` but it didn't help. I also experimented with breaking the file into smaller chunks and copying each chunk separately, but I found that the implementation becomes overly complex and doesn’t seem to offer any important performance improvement. Has anyone encountered similar issues? Is there a recommended approach for handling large file transfers in Azure Blob Storage while avoiding timeouts? Any insights would be greatly appreciated! Any help would be greatly appreciated! I'm working in a Ubuntu 20.04 environment. Any examples would be super helpful. This is part of a larger service I'm building. Hoping someone can shed some light on this. This is my first time working with C# LTS. What am I doing wrong? How would you solve this? Could this be a known issue?