Copied to clipboard

Flag this post as spam?

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


  • Martin 810 posts 1221 karma points c-trib
    Jun 24, 2022 @ 12:48
    Martin
    0

    Image Processor not cropping with Azure Blob storage

    I really hope somebody can help me with this problem as i've been scratching my head all day!

    Media is serving from blob storage just fine, but Image processor isn't working at all and it's not creating a cache folder in app_data either. So the images appear at full size and not cropped.

    I've noted this has been an issue in the past, and i've looked through quite a few old posts but I just don't seem to find that crucial mistake I'm assuming I have somewhere in my configs!

    I'm NOT using a CDN (blob cache) for now, but may consider it in future.

    The set-up is as follows...

    1. Umbraco 7.15.7
    2. Azure App service set to run on ASP.net 4.8
    3. Framework in project is 4.7.2
    4. ImageProcessor 2.8
    5. ImageProcessor.Web 4.11.0
    6. ImageProcessor.Plugins.WebP 1.2.0.100
    7. UmbracoFileSystemProviders.Azure 1.2.0

    I have my config files all set-up fine as in documentation and i've ensured a media entry for static file handling exists for "media" in my web.config. Finally the container is set to public.

    cache.config

    <?xml version="1.0" encoding="utf-8"?>
    <caching currentCache="DiskCache">
      <caches>
        <cache trimCache="false" name="DiskCache" type="ImageProcessor.Web.Caching.DiskCache, ImageProcessor.Web" maxDays="365" memoryMaxMinutes="1" browserMaxDays="7">
          <settings>
            <setting key="VirtualCachePath" value="~/app_data/cache" />
          </settings>
        </cache>
      </caches>
    </caching>
    

    security.config

    <?xml version="1.0" encoding="utf-8"?>
    <security>
        <services>
            <service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
                <settings>
                    <setting key="Container" value="media-uk"/>
                    <setting key="MaxBytes" value="819430"/>
                    <setting key="Timeout" value="30000"/>
                    <setting key="Host" value="https://myprovider.blob.core.windows.net/"/>
                </settings>
            </service>
            <service prefix="remote.axd" name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
                <settings>
                    <setting key="MaxBytes" value="819430"/>
                    <setting key="Timeout" value="3000"/>
                    <setting key="Protocol" value="http"/>
                </settings>
                <whitelist>
                </whitelist>
            </service>
        </services>
    </security>
    

    FilesystemProviders.config

    <FileSystemProviders>
        <!-- Media -->
        <Provider alias="media" type="Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem, Our.Umbraco.FileSystemProviders.Azure">
            <Parameters >
                <add key="containerName" value="media-uk"/>
                <add key="rootUrl" value="http://provider-name.blob.core.windows.net/"/>
                <add key="connectionString"
                    value="DefaultEndpointsProtocol=https;AccountName=zzz;AccountKey=zzzz;EndpointSuffix=core.windows.net"/>
                <!--
            Optional configuration value determining the maximum number of days to cache items in the browser.
            Defaults to 365 days.
        -->
                <add key="maxDays" value="365"/>
                <!--
            When true this allows the VirtualPathProvider to use the default "media" route prefix regardless
            of the container name.
        -->
                <add key="useDefaultRoute" value="true"/>
                <!--
            When true blob containers will be private instead of public what means that you can't access the original blob file directly from its blob url.
        -->
                <add key="usePrivateContainer" value="false"/>
            </Parameters>
        </Provider>
    </FileSystemProviders>
    
  • Chris Fitz-Avon 3 posts 94 karma points c-trib
    Jun 24, 2022 @ 17:48
    Chris Fitz-Avon
    0

    Hi Martin, have you tried removing the ;EndpointSuffix=core.windows.net from the connection string in FilesystemProviders.config? I seem to remember that was one of the potential configuration problems.

  • Martin 810 posts 1221 karma points c-trib
    Jun 29, 2022 @ 13:20
    Martin
    0

    Chris, thanks for the suggestion I tried it but it didn't work.

    I've played around with just about every combination I can think of with no luck. I'm pretty sure it worked fine when the container itself was called "media". So i've asked our DevOps guy to change the name back and see if it's just being a bit crap!

    It's not working on localhost (dev) either if I point to the container. So I still have an incorrect config or container naming is rigid. I've not seen any evidence in many of the topic discussions that containers HAVE to be named "media" though.

  • Martin 810 posts 1221 karma points c-trib
    Jul 04, 2022 @ 15:22
    Martin
    0

    If anyone is having continued issues with Azure blob storage and Umbraco 7.x. This page solved my issues with getting the configs exactly right.

    https://github.com/umbraco-community/UmbracoFileSystemProviders.Azure/blob/develop-version-1/README.md

Please Sign in or register to post replies

Write your reply to:

Draft