WebRole Starts Cycling after Deploying on Windows Azure
|Product||Progress® Telerik® Reporting|
Windows Azure Activity log shows:
Instance 0 of role WebRole1 is cycling.
Server Explorer shows:
Windows Azure > Cloud Services > [service name] > [environment] > [WebRole1] > Instance 0 (Cycling Role)
Windows Azure Portal shows:
One or more role instances are unhealthy. 1 Instance: 1 Unhealthy
This problem happens when you are trying to deploy an MVC 5 project which utilizes Telerik Reporting WebAPI REST service.
Usually, the MVC 5 project is also referencing the Web API 2 assemblies while the reports service is built against Web API 1 assemblies.
For this reason, several assembly binding redirects have to be added in order the service to start properly.
After deploying a WebRole which utilizes Telerik Reporting WebAPI REST Service to Windows Azure, the role becomes restarting and goes into a cycling state.
- Add a new file named [MyWebRoleName].dll.config to the Web Role project at the same level as the web.config file is.
- Set its Copy to Output Directory property to Copy always.
Add the following assembly binding redirects:
<?xml version="1.0"?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="0.0.0.0-22.214.171.124" newVersion="126.96.36.199"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="0.0.0.0-188.8.131.52" newVersion="184.108.40.206"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
Check the exact versions of the referenced
System.Net.Nttp.Formattingassemblies in order to setup the binding redirects correctly.
Publish the solution to Windows Azure.
Keep in mind that Windows Azure Web Apps (in Free and Shared modes) restricts applications to access some system resources, including GDI API, and rendering extensions as PDF would not be able to produce a document.