AzureReader2 gives me a 400 Bad request when enabled

270 views Asked by At

My website is running on Azure with ImageResizer, AzureReader2 and DiskCache turned on. When I edit and deploy changes to the live website I get 400 Bad request errors on the website. If I disable AzureReader2 in Web.config the pages show up perfectly but obviously with the images missing. When I enable AzureReader2 the pages that I browsed earlier with AzureReader2 turned off work perfectly with the images being resized as expected, however the pages that weren't browsed give me a 400 Bad request. I've searched for a good day and a half for a solution but I haven't found anything that addresses this problem. Any idea on how I could resolve this for good would be awesome! Thanks.

Here's the test website: http://iwktest.azurewebsites.net/

Here's my diagnostics page:
Image resizer diagnostic sheet      6/23/2015 11:16:33 AM

0 Issues detected:


You are using plugins from the Performance Edition: DiskCache (Performance Edition), AzureReader2Plugin (Performance Edition)

Registered plugins:

ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.SizeLimiting
ImageResizer.Plugins.DiskCache.DiskCache
ImageResizer.Plugins.AzureReader2.AzureReader2Plugin

Configuration:

<resizer>
<pipeline fakeExtensions=".ashx" />
<plugins>
<add name="DiskCache" />
<add name="AzureReader2" connectionString="[redacted]" endpoint="http://iwkimages.blob.core.windows.net/" prefix="~/" />
</plugins>
</resizer>


Accepted querystring keys:

quality, format, thumbnail, maxwidth, maxheight, width, height, w, h, scale, stretch, crop, cropxunits, cropyunits, page, bgcolor, rotate, flip, sourceFlip, sFlip, sRotate, borderWidth, borderColor, paddingWidth, paddingColor, ignoreicc, frame, useresizingpipeline, cache, process, margin, anchor, dpi, mode, zoom, 

Accepted file extensions:

bmp, gif, exif, png, tif, tiff, tff, jpg, jpeg, jpe, jif, jfif, jfi, 

Environment information:

Running Microsoft-IIS/8.0 on Microsoft Windows NT 6.2.9200.0 and CLR 4.0.30319.36213
Trust level: Unrestricted
OS bitness: x86 !! Warning, running as 32-bit on a 64-bit OS(AMD64). This will limit ram usage !!
Executing assembly: D:\Windows\SysWOW64\inetsrv\w3wp.exe
IntegratedPipeline: True

Loaded assemblies:

mscorlib                                 Assembly: 4.0.0.0         File: 4.0.30319.36213 Info: 4.0.30319.36213
System.Web                               Assembly: 4.0.0.0         File: 4.0.30319.36283 Info: 4.0.30319.36283
System                                   Assembly: 4.0.0.0         File: 4.0.30319.34239 Info: 4.0.30319.34239
System.Core                              Assembly: 4.0.0.0         File: 4.0.30319.36213 Info: 4.0.30319.36213
System.Web.ApplicationServices           Assembly: 4.0.0.0         File: 4.0.30319.34248 Info: 4.0.30319.34248
System.Configuration                     Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.Xml                               Assembly: 4.0.0.0         File: 4.0.30319.36241 Info: 4.0.30319.36241
System.Runtime.Caching                   Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Microsoft.Build.Utilities.v4.0           Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Microsoft.Web.Compilation.Snapshots      Assembly: 1.0.0.0         File: 1.1.0.0        
Microsoft.JScript                        Assembly: 10.0.0.0        File: 11.0.50709.17929 Info: 11.0.50709.17929
EnvSettings                              Assembly: 1.0.0.0         File: 46.0.8598.1007  Info: 46.0.8598.1007 (rd_websites_stable.150620-0845)
System.Web.WebPages.Deployment           Assembly: 1.0.0.0         File: 1.0.20105.407  
App_Code.tneplgwm                        Assembly: 0.0.0.0        
System.Data                              Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
App_global.asax.wwlyy9nh                 Assembly: 0.0.0.0        
System.Web.Extensions                    Assembly: 4.0.0.0         File: 4.0.30319.34248 Info: 4.0.30319.34248
System.ServiceModel.Activation           Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
Microsoft.CSharp                         Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Web.Services                      Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.Drawing                           Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.EnterpriseServices                Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.IdentityModel                     Assembly: 4.0.0.0         File: 4.0.30319.34230 Info: 4.0.30319.34230
System.Runtime.Serialization             Assembly: 4.0.0.0         File: 4.0.30319.34230 Info: 4.0.30319.34230
System.ServiceModel                      Assembly: 4.0.0.0         File: 4.0.30319.36241 Info: 4.0.30319.36241
System.ServiceModel.Web                  Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.Activities                        Assembly: 4.0.0.0         File: 4.0.30319.34230 Info: 4.0.30319.34230
System.ServiceModel.Activities           Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.WorkflowServices                  Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Data.DataSetExtensions            Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Xml.Linq                          Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.ComponentModel.DataAnnotations    Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Web.DynamicData                   Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
ASPnetPagerV2_8                          Assembly: 2.8.3227.25225  File: 2.8.0.0        
Hyak.Common                              Assembly: 1.0.0.0         File: 1.0.2.0        
ImageResizer                             Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
ImageResizer.Plugins.AzureReader         Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
ImageResizer.Plugins.AzureReader2        Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
ImageResizer.Plugins.DiskCache           Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
Microsoft.Azure.Common                   Assembly: 2.0.0.0         File: 2.1.0.0        
Microsoft.Azure.Common.NetFramework      Assembly: 2.0.0.0         File: 2.1.0.0        
Microsoft.Azure.KeyVault.Core            Assembly: 0.9.0.0         File: 0.9.1.0        
Microsoft.Azure.Management.Sql           Assembly: 0.9.0.0         File: 0.29.0.0       
Microsoft.Data.Edm                       Assembly: 5.6.2.0         File: 5.6.2.61936     Info: 5.6.2.61936
Microsoft.Data.OData                     Assembly: 5.6.2.0         File: 5.6.2.61936     Info: 5.6.2.61936
Microsoft.Data.Services.Client           Assembly: 5.6.2.0         File: 5.6.2.61936     Info: 5.6.2.61936
Microsoft.Threading.Tasks                Assembly: 1.0.12.0        File: 1.0.168.0       Info: 1.0.168.0
Microsoft.Threading.Tasks.Extensions.Desktop Assembly: 1.0.168.0       File: 1.0.168.0       Info: 1.0.168.0
Microsoft.Threading.Tasks.Extensions     Assembly: 1.0.12.0        File: 1.0.168.0       Info: 1.0.168.0
Microsoft.WindowsAzure.Configuration     Assembly: 2.0.0.0         File: 2.0.2.0        
Microsoft.WindowsAzure.Storage           Assembly: 2.1.0.3         File: 2.1.0.3        
Microsoft.WindowsAzure.StorageClient     Assembly: 1.7.0.0         File: 6.0.6002.18488 
Newtonsoft.Json                          Assembly: 6.0.0.0         File: 6.0.8.18111    
System.IO                                Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Net.Http                          Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Net.Http.Extensions               Assembly: 2.2.22.0        File: 2.2.22.0        Info: 2.2.22.0
System.Net.Http.Primitives               Assembly: 2.2.22.0        File: 2.2.22.0        Info: 2.2.22.0
System.Net.Http.WebRequest               Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Runtime                           Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.Spatial                           Assembly: 5.6.2.0         File: 5.6.2.61936     Info: 5.6.2.61936
System.Threading.Tasks                   Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Net                               Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.Transactions                      Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.ServiceModel.Internals            Assembly: 4.0.0.0         File: 4.0.30319.34230 Info: 4.0.30319.34230
Microsoft.WindowsAzure.ServiceRuntime    Assembly: 2.6.0.0         File: 2.6.1198.712    Info: 2.6.1198.712 (rd_art_stable.150223-1353)
msshrtmi                                 Assembly: 2.6.0.0        
Microsoft.WindowsAzure.WebSites.Diagnostics Assembly: 1.0.0.0         File: 46.0.8598.1007  Info: 46.0.8598.1007 (rd_websites_stable.150620-0845)
Microsoft.Azure.Websites.StorageSdk      Assembly: 4.1.0.0         File: 4.1.0.0        
System.Web.RegularExpressions            Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
SMDiagnostics                            Assembly: 4.0.0.0         File: 4.0.30319.34230 Info: 4.0.30319.34230
System.Xaml.Hosting                      Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Xaml                              Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
App_Web_3ugoikon                         Assembly: 0.0.0.0        
App_Web_hb2au1pk                         Assembly: 0.0.0.0        
App_Web_g5nsnuqc                         Assembly: 0.0.0.0        
App_Web_dzoq4fux                         Assembly: 0.0.0.0        
App_Web_wikwjgud                         Assembly: 0.0.0.0        
App_Web_jpawolt0                         Assembly: 0.0.0.0        
App_Web_i1ekkccj                         Assembly: 0.0.0.0        
App_Web_xk1ukx11                         Assembly: 0.0.0.0        
App_Web_iciotjon                         Assembly: 0.0.0.0        
App_Web_io0d5en1                         Assembly: 0.0.0.0        
System.Web.Mobile                        Assembly: 4.0.0.0         File: 4.0.30319.34248 Info: 4.0.30319.34248
App_Web_fldm00ds                         Assembly: 0.0.0.0        
App_Web_jmu24pv1                         Assembly: 0.0.0.0        
System.Data.Services.Client              Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929

The following plugin assemblies are loaded but do not seem to be in use. You should remove them (and especially their dependencies (unless used elsewhere)) from the /bin folder to improve application load times:

ImageResizer.Plugins.AzureReader         Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7

Reference list of plugin dependencies - so you know what additional dlls to remove when removing a plugin. (may not be up-to-date, see plugin docs):

The FreeImage plugin has the following dependencies: FreeImage.dll and FreeImageNET.dll
The Logging plugin depends on: NLog.dll
The AdvancedFilters, RedEye, and WhitespaceTrimmer plugins depend on: AForge.dll, AForge.Math.dll, and AForge.Imaging.dll
The PsdReader and PsdComposer plugins depend on: PsdFile.dll
The S3Reader plugin depends on: LitS3.dll
The BatchZipper plugin depends on: Ionic.Zip.Reduced.dll
The PdfRenderer plugin depends on gsdll32.dll or gdsll32.dll
The RedEye plugin depends on several dozen files... see the plugin docs.

This is a glimpse of the web.config file

<plugins>
      <!-- For Image resizer image caching -->
      <add name="DiskCache" />
      <!-- Azure Blob reader   -->
      <add name="AzureReader2" connectionString="DefaultEndpointsProtocol=https;AccountName=iwkimages;AccountKey=******" endpoint="http://iwkimages.blob.core.windows.net/" prefix="~/" />
    </plugins>
1

There are 1 answers

14
Lilith River On

This error means that Microsoft.WindowsAzure.StorageClient 1.7.0.0 is producing invalid requests to the Azure server. You should upgrade to a version 2.1 or higher, as older Azure libraries are no longer supported by Microsoft.