Search code examples
azure-storageazure-web-app-serviceimageresizer

ImageResizer using AzureReader2 returns 404s for resized images when deployed in RELEASE mode to Azure website


I have an MVC website (MVC 5.2.2.0), that uses ImageResizer and Azure Blob Storage, using the AzureReader2 plugin.

I am using default settings, so images will be accessed through /azure/images (where "images" is the name of my container), and it works perfectly in development - and if I deploy to an Azure Website using Debug settings.

If I deploy using Release settings, images stop working and return 404s with a times new roman text "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.", as shown below.

enter image description here

This is from my web.config, and is NOT modified on release (I double-checked):

<resizer>
 <plugins>
  <add name="MvcRoutingShim" />
  <add name="AzureReader2" connectionString="DefaultEndpointsProtocol=http;AccountName=[accountname];AccountKey=[KEY]" endpoint="http://[account].blob.core.windows.net/" />
  <add name="DiskCache" />
 </plugins>
</resizer>

I am lost and don't know where to begin troubleshooting. I have tried disabling DiskCache plugin, which does not make any difference.


Solution

  • This is most likely because your configuration is enabling pre-compilation when you switch to release mode. Disabling pre-compilation should allow VirtualPathProviders to work again.

    See "File Not Found - cause #4" in the Troubleshooting Guide for more information.