Copied to clipboard

Flag this post as spam?

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


  • Ivan Nikolov 1 post 21 karma points
    Mar 13, 2020 @ 13:03
    Ivan Nikolov
    0

    Using UmbracoFileSystemProviders.Azure.Media does not process media files in Azure blob uploaded from Umbraco BackOffice

    Hi guys,

    I am using AzureBlob container to store Umbraco media files with UmbracoFileSystemProviders.Azure and UmbracoFileSystemProviders.Azure.Media Nuget packages, but it does not work when I upload new image in Umbraco media. I already had a list of media files, which I uploaded manually to AzureBlob and for them everything works, so I can see them in Umbraco BackOffice and my site also renders them. The issue is when I upload new image from BackOffice, it seems the image is stored in the container, but the BackOffice tries to render it using the blob url, not the CMS url.

    https://[CMS]/media/q3ib0inw/building.jpg - works

    https://[BlobURL]/media/q3ib0inw/building.jpg - does not work

    For the manually uploaded media files Umbraco BackOffice tries to render the CMS URL and it works. For the new uploaded images (through BackOffice), it tries to render the Blob Url (instead of the CMS one) and it does not work.

    Here are my configurations for security.config

    <service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
      <settings>
        <setting key="Container" value="media"/>
        <setting key="MaxBytes" value="8194304"/>
        <setting key="Timeout" value="30000"/>
        <setting key="Host" value="https://[bloburl].blob.core.windows.net/media"/>
      </settings>
    </service>
    
    <service prefix="remote.axd" name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
      <settings>
        <setting key="MaxBytes" value="4194304"/>
        <setting key="Timeout" value="3000"/>
        <setting key="Protocol" value="http"/>
      </settings>
      <whitelist>
        <add url="https://[bloburl].blob.core.windows.net/" />
        <add url="https://[CMSURL].azurewebsites.net/" />
        <add url="http://localhost" />
        <add url="http://127.0.0.1" />
      </whitelist>
    </service>
    

  • Ambert van Unen 175 posts 817 karma points c-trib
    Jun 02, 2021 @ 07:57
    Ambert van Unen
    0

    Did you ever manage this? I'm having the same issue at the moment.

  • Andy Felton 185 posts 484 karma points c-trib
    Feb 23, 2022 @ 12:29
    Andy Felton
    0

    Hi,

    I'm having the same problem with Umbraco 8 and using AWS S3 for the media storage. I've tried the same thing with Azure blob storage and can confirm it also fails with that.

    Having done some debugging I've chased this down to an issue with the image processor and in particular the disk cache. On line 371 of DiskCache.cs the following line tries to check if the object is a file or stored on the web.

     if (new Uri(this.RequestPath).IsFile)
    

    The issue is at this point for a web-based image the RequestPath is set to:

    ssbhy3qv/image.png
    

    which causes the new Uri to throw an exception, for images stored on disk the RequestPath is a mapped path to the drive so works. The issue with the exception is that it now assumes the image has not been updated.

    Does anybody have a setup where they know this works so I can work out the difference?

    Thanks Andy

Please Sign in or register to post replies

Write your reply to:

Draft