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 610 posts 1032 karma points MVP 6x c-trib
    May 23, 2022 @ 20:18
    Heather Floyd
    2

    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: https://our.umbraco.com/documentation/Extending/FileSystemProviders/Azure-Blob-Storage/ )

    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 218 karma points hq c-trib
    May 24, 2022 @ 08:13
    Ronald Barendse
    106

    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 610 posts 1032 karma points MVP 6x c-trib
    May 24, 2022 @ 16:23
    Heather Floyd
    2

    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...?)

  • Marshall Penn 84 posts 269 karma points
    Mar 06, 2024 @ 14:04
    Marshall Penn
    0

    Hi Ronald,

    Is the "ContainerRootPath" there to allow multiple Umbraco installations to use the same Blob account - separated by this "ContainerRootPath" value? I have done this on AWS storage, but did not know you could do it with Azure....

  • Gurumurthy 54 posts 127 karma points
    Sep 29, 2023 @ 18:07
    Gurumurthy
    0

    Hi All,

    This thread seems to be impressive, even I was facing the same problem with "ContainerRootPath" and not it got fixed, and media images are loading.

    The background is that I am upgrading one of my v8 to v12.

    Now I having a issue that is, media are loading, but the /cache folder is not getting created in Azure blob or either I could not find /MediaCache folder even in my local or even in Azure.

    Not sure what's wrong with my config. Also, I using image cropper crop sizes to crop the images, which is also not working.

    Any inputs/suggestions on this will be helpful.

    Thanks,
    Gurumurthy JV

Please Sign in or register to post replies

Write your reply to:

Draft