Copied to clipboard

Flag this post as spam?

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


  • Andy 12 posts 92 karma points
    May 01, 2016 @ 18:41
    Andy
    0

    AzureFileSystemProvider 404 when deployed to Azure Website

    Hi,

    I'm using the Azure Blob Storage IFileSystem Provider https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure to store images in blob storage for my site. This all works perfectly in development but when deployed to azure i get a 404 on all images.

    This happens in both the backoffice and front end. Images i upload through the back office are visible in the media container (viewed using cloud explorer), when ever i go to the image url i get a 404.

    It may also be worth noting I have noticed the cache folder under App Data seems to be missing on the azure website.

    Any help appreciated

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 01, 2016 @ 18:47
    Jeavon Leopold
    0

    Hi Andy,

    Are you using a precompiled website project?

    Jeavon

  • Andy 12 posts 92 karma points
    May 01, 2016 @ 18:51
    Andy
    0

    Hi Jeavon,

    No, its a VS project i installed the packed through nuget and then updated the FileSystemProviders.config to point to my storage account

    Apology's Jeavon i miss read that, yes the project is precompiled when published

    Thanks,

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 01, 2016 @ 20:38
    Jeavon Leopold
    100

    Ah ok, that's why then. (VPP) virtual path providers do not work with precompiled sites and the package relies on a VPP.

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 01, 2016 @ 20:45
    Jeavon Leopold
    0

    There are some workarounds on the internet but generally the solution is to use a compiled Web Application project rather than a Website project.

  • Andy 12 posts 92 karma points
    May 01, 2016 @ 20:47
    Andy
    0

    That's fixed the issue, thanks for the info, saved me a lot of time :)

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 01, 2016 @ 20:56
    Jeavon Leopold
    0

    Fab!

  • Andy 12 posts 92 karma points
    May 01, 2016 @ 22:16
    Andy
    0

    Possibly should have started a new post for this as i resolved, anyways, the initial issue of not seeing the images in the back office is now resolved thanks to Jeavon, however i am still getting 404's form the front end.

    When I upload an image I can see the image is created in blob storage and pulls into the back office as you would expect. If i then click on the link to media or try and display the image in the front end i still get a 404.

    It looks to me like the blob storage provider is now working as it should, and another element of Umbraco is miss configured.

    Does anyone have any idea what could cause this as i'm struggling to debug, bit of an umbraco newbie!

    Thanks

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 01, 2016 @ 22:26
    Jeavon Leopold
    0

    Have you configured the cloud image service in config/imageprocessor/security.config?

    https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure#combining-with-imageprocessor

  • Andy 12 posts 92 karma points
    May 01, 2016 @ 22:29
    Andy
    0

    Yes here's the security config

    <?xml version="1.0"?>
    <security>
      <services>
        <service name="LocalFileImageService" type="ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web"/>
        <service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
          <settings>
            <setting key="MaxBytes" value="8194304"/>
            <setting key="Timeout" value="30000"/>
            <setting key="Host" value="http://mystorageaccount.blob.core.windows.net/media/"/>
          </settings>
        </service>
      </services>
    </security>
    

    Might be worth mentioning this isn't working locally now either

    Thanks,

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 01, 2016 @ 22:34
    Jeavon Leopold
    0

    Only thing I can think of is to check that your media container is set to public (read only) and not private

  • Andy 12 posts 92 karma points
    May 01, 2016 @ 22:39
    Andy
    0

    Just had a look and its set to Public read access (blobs only). The files are also being cached locally so umbraco should use the cache if my understandings correct

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 02, 2016 @ 12:15
    Jeavon Leopold
    0

    Well that is confusing, are you requesting images with a ImageProcessor querystring or without?

    By caching you mean that files are being created in App_Data/Cache folder?

    Are you using IIS or IISExpress?

  • Andy 12 posts 92 karma points
    May 03, 2016 @ 07:55
    Andy
    0

    Without the image processor query string.

    Yes by caching i mean the images are moving to the App_Data/Cache folder.

    If i put this entry in the web config it seems to work in dev.

    <location path="Media">
        <system.webServer>
          <handlers>
            <remove name="StaticFileHandler" />
            <add name="StaticFileHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.StaticFileHandler" />
          </handlers>
        </system.webServer>
      </location>
    
  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 03, 2016 @ 08:33
    Jeavon Leopold
    0

    Ok, so without any querystrings you are using the VPP but that would not be creating images in App_Data/Cache, those come from ImageProcessor.Web. Are you you using the latest ImageProcessor and ImageProcessor.Web packages and do you have intercept all requests on?

  • Andy 12 posts 92 karma points
    May 03, 2016 @ 12:23
    Andy
    0

    I am using ImageProcessor 2.3.2.0 and ImageProcessor.Web 4.5.1.0 also intercept all request is set to false, I'll delete the App_Data/Cache folder and see at what point the images are pulled back down to the folder.

  • Andy 12 posts 92 karma points
    May 04, 2016 @ 08:04
    Andy
    0

    Thanks for your help on this one Jeavon, deleted the bin folder and re-published and now its all working.

    Thanks again

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 04, 2016 @ 10:26
    Jeavon Leopold
    0

    Ah cool, suspect you had some of the precompiled stuff left in there

Please Sign in or register to post replies

Write your reply to:

Draft