Umbraco 13 - Azure Blob Storage

Hi there.

We are experincing an issue with Azure Blob Storage and the .AddAzureBlobMediaFileSystem()
.AddAzureBlobImageSharpCache() methods. The iamges being loaded through Azure integration, is extremly slow. But if we use the cdn for an image, then its quick, as in 30ms for load of the images.

If we use the Azure methods in program.cs then the images from the blob storage takes an average of 5-6 seconds pr image to load. But if we test with the cdn directly from azure, then its down to 450ms pr image.

Can you guys help me debug what exactly is going on?

Just a quick check: be absolutely sure that the AddAzureBlobMediaFileSystem and AddAzureBlobImageSharpCache are added AFTER AddComposers extension. If not, the cache will not properly work and in that case the images gets generated every single time. That’s based on a real experience unfortunately…

You should have two folders in your blob: media and cache. Both should have files in them.

Hi there.

We have already done that, so that is not the issue.

I think its related to the syncronous load that the AddAzureBlobMediaFileSystem nuget apckage uses (like some other posts on the forum has suggested) - because imagesharp in itself is fast in regards to load times, and azure aswell if you make the asset public and then fetch the image.
But as soon as you use “AddAzureBlobMediaFileSystem, AddAzureBlobImageSharpCache” then its extremely slow.

Do you know if there is a potential other soloution? The images needs to be located in Azure for our project.

Does anyone have any experience and can help me?

If you followed the installation steps, it should just work.

  1. Install package

  2. Configure connectionstrings

  3. Add c# references:

    builder.CreateUmbracoBuilder()
    .AddBackOffice()
    .AddWebsite()
    .AddDeliveryApi()
    .AddComposers()
    .AddAzureBlobMediaFileSystem() // required services for Media .AddAzureBlobImageSharpCache() // required services for the Image Sharp cache .Build();

  4. Copy any existing disk media files to the blob storage account

If performance is slow, it sounds like it is either:

  1. Azure (check appropriate region / service level, maybe try removing the old azure blob and recreating it?)
  2. Third party packages / customizations interfering (can’t think of how though)
  3. Super large media files? Though Azure should be able to handle it.

I’ve used Azure blob storage with Umbraco 13 on multiple sites and it has never been slow.

Hi Mikkel,

We’ve seen slowdowns in blob storage with Umbraco in certain scenarios - usually when there is a lot of traffic or with an underpowered web app. You’ve already called out the synchronous nature of the underlying filesystem, which can be problematic.

A few questions:

  • What size is your Azure Web App?
  • Are you using any profiling tools or APM (e.g. Application Insights) to see where those seconds are being spent?
  • How much traffic are we talking about?

Irrespective to your answers to these questions though, it’s important to understand that when using Blob storage for Images, your Umbraco site is essentially acting as a proxy - streaming those images from Blob storage to the user. The AzureBlobImageSharpCache saves CPU, since images will need resizing less often, but the cost of that is 2x TCP thread usage + the overhead of streaming all that image data. So Umbraco.StorageProviders.AzureBlob is not a magic bullet, it’s a trade off.

In my experience, as soon as we start seeing meaningful amounts of traffic in production, a CDN in front of Umbraco is required to get acceptable performance out of media. Using Cloudflare or Azure CND/Front Door to cache image requests so that they actually hit the Umbraco site as infrequently as possible.

2 Likes