Azure App Service slow response times when integrating with Azure Blob Storage using .NET 5
I've hit a wall trying to I'm experiencing significantly slow response times when my Azure App Service tries to access Azure Blob Storage. My app is built on .NET 5 and uses the Azure.Storage.Blobs library version 12.10.0. I've implemented asynchronous calls to get blobs, but the latency is still around 3-5 seconds per call, which is not acceptable for my use case. Here’s a snippet of the code I'm using to retrieve a blob: ```csharp using Azure.Storage.Blobs; using Azure.Storage.Blobs.Models; var blobServiceClient = new BlobServiceClient("<Your_Connection_String>"); var blobContainerClient = blobServiceClient.GetBlobContainerClient("<Your_Container_Name>"); var blobClient = blobContainerClient.GetBlobClient("<Your_Blob_Name>"); BlobDownloadInfo download = await blobClient.DownloadAsync(); using (var streamReader = new StreamReader(download.Content)) { string content = await streamReader.ReadToEndAsync(); // Process the content } ``` I’ve tried enabling the connection string with the `DefaultEndpointsProtocol=https;`, and I’ve also made sure that the `BlobContainerClient` is not recreated unnecessarily, but the performance hasn’t improved. Additionally, I’m calling this method within an Azure Function with a premium plan, so I expected better performance. I've tested the same Blob Storage access locally, and it's much quicker. However, the latency spikes dramatically when deployed to the Azure App Service. Are there any known issues with Azure App Service and Blob Storage interactions, or specific settings I should configure to optimize this? I've also looked into the Azure Monitor and Application Insights metrics, but I didn’t find any specific throttling or limits being hit. Any advice on how to diagnose or resolve this would be greatly appreciated! My development environment is macOS. Has anyone else encountered this? Cheers for any assistance!