Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Heather Floyd 582 posts 892 karma points MVP 4x c-trib
    May 23, 2022 @ 20:18
    Heather Floyd

    Updating Site from Umbraco 7 to Umbraco 9 - Existing Azure Blob Storage Media showing 404s

    Hi, I am updating a v7 site to v9. The original v7 site is using Azure Blob Storage. In the new v9 version, I added the configuration to point to the existing Blob Storage. (as per: )

    Since the DB upgrade, I can see all the media nodes in the back-office, but the images/files are all returning 404s.

    There are no errors in the Log related to Authentication issues with Azure, and if I test the Azure connection string via the ‘MS Azure Storage Explorer’ app, I can see bunches of numbered folders present.

    In the documentation for the Umbraco.StorageProviders package, it mentions there are two folders used - the /media/ folder, with the actual files, and the /cache/ folder, which stores processed versions. I wonder if the assumption of these two folders is what is causing the 404s - since the v7 site has only the /media/ folder, and thus that is the root of the storage container?

    Related to that, I saw a PR to Add ContainerRootPath option, and updated my config to include "ContainerRootPath": "/" but I am still seeing the same error, so I'm not sure what needs to be done - whether there is something I can configure in the v9 site, or if I need to set up a new Storage container with the two folders?

    As per the docs, I have "ContainerName": "media" and the storage explorer shows this:

    enter image description here

  • Ronald Barendse 39 posts 213 karma points hq c-trib
    May 24, 2022 @ 08:13
    Ronald Barendse

    Hi Heather, you're on the right track: the v9 package does indeed use the same container for storing both media and cache (images processed by ImageSharp) and you should be able to override the default path using ContainerRootPath (make sure to use version 1.1.0).

    You might want to try using an empty string, so you have this config:

      "Umbraco": {
        "Storage": {
          "AzureBlob": {
            "Media": {
              "ConnectionString": "...",
              "ContainerName": "media",
              "ContainerRootPath": ""

    Also keep in mind that the ImageSharp cache will use a fixed cache folder name and would therefore end up inside your media storage (and exposed publicly). You can opt out of using Azure Blob Storage for this cache (and use the default physical file cache), which makes most sense if you already have a CDN in place that caches the processed images.

  • Heather Floyd 582 posts 892 karma points MVP 4x c-trib
    May 24, 2022 @ 16:23
    Heather Floyd

    Brilliant! Thanks Ronald 💖

    Using "ContainerRootPath": "" did it!

    In general I wouldn't be too concerned about the cache being visible... unless you know of a reason that would be a concern?

    One other question... I noticed in the back-office that the existing media items do not have file type (umbracoExtension) or size (umbracoBytes) data. Is there an easy way I can update all the media to include those types of information? (I know I can click "Save" on each one and that updates it, but there are thousands of media items, so wondering if I could do it programmatically? Perhaps looping through them all using MediaService...?)

Please Sign in or register to post replies

Write your reply to: