ImageProcessor security config for Umbraco + Azure Storage Emulator

This is only going to work if you’re using ImageProcessor with Umbraco to deal with images being loaded from blob storage in the Azure Storage Emulator. Took me a while to get the settings right, the way I figured it out was:

  • firstly, use Azure Storage Explorer to find the URL for your emulated blob container and make sure that works by requesting from there directly
  • Find the URL it’s attempting to use by catching the ImageProcessingExceptions that get thrown when it can’t find the file

Once I had both the correct URL as well as the URL that it was attempting to use, figuring out what to put in the config was just trial and error.  Here’s what I ended up with:

<service name="CloudImageService” prefix="media" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web”>
<settings>
<setting key="Container” value="devstoreaccount1/media”/>
<setting key="MaxBytes” value="16777216”/>
<setting key="Timeout” value="30000”/>
<setting key="Host” value="http://127.0.0.1:10000”/>
</settings>
</service>

The tricky part was that the instructions on the ImageProcessor website say to put the container name inside the “Host” value, which didn’t seem to work. They also don’t mention that the “container” value there isn’t actually the name of the “blob container” itself but the full path to where Umbraco’s media filesystem lives. Also, that “prefix” value was confusing, it seems to be more about which URL to catch requests for, rather than anything to do with the blob storage or file path etc.