More on Running Crystal Reports on Azure

Since in our software due to pricing of SSRS on Azure we chose not to use that reporting solution, we decided to go with Crystal Reports.  I already blogged about that once here. Since then I encountered a few more issues that I wanted to document.

Copying Crystal JavaScript files worked for us for brand new deployment just fine.  However, upgrading the deployment did not work correctly.  The reason for that is how upgrade works on Azure.  When Azure processes upgrades for your deployment, it uses the same virtual before, then it mounts and images new drive with your application on it, then mounts that drive onto that virtual machine, then removes the old drive.  I use word “drive” loosely here, as it looks like a drive from the Windows perspective and application perspective as well.  A drive letter is assigned to the new drive, letter, first available after D, where Windows is installed.  As a result, upgrades will move your application typically between E and F drive letters.  Now you see why the old script will not work.  To avoid complex scripting, I simply try now to copy Crystal scripts to both E and F.

ECHO "Starting CrystalReports Installation" >> log.txt
msiexec.exe /I "CRRuntime_64bit_13_0_4.msi" /qn
ECHO "Completed CrystalReports Installation" >> log.txt
ECHO "Trying both drive letter in case image changes"
robocopy D:inetpubwwwroot E:sitesroot /S
robocopy D:inetpubwwwroot F:sitesroot /S

ECHO "Copied crystal files" >> log.txt

The next problem we found was the reports would just stop running sometime.  The error logged into Event Viewer was as follows.

The maximum report processing jobs limit configured by your system administrator has been reached.
   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()


If you search for this error on the internet, you will find many references to it, but no definite solutions.  One that we simply found through trial and error was to recycle the app pool often, releasing all the resources.  Since our Crystal Reports web site is isolated and has nothing else running on it, we opted to make sure the app stays up, so we decided to change default app pool recycle time from default 29 hours.  The actual time varies based on the load, and we set ours to 10 minutes.  Of course, we have to script this on Azure.  Here is what I had to add to StartUp.cmd from previous post (or the one above).

%windir%system32inetsrvappcmd set config -section:applicationPools -applicationPoolDefaults.recycling.periodicRestart.time:00:10:00

Here is the same code split into two lines so that you can see it all.  You have to put it all on one line as above.

%windir%system32inetsrvappcmd set config -section:applicationPools 



Leave a Reply

Your email address will not be published. Required fields are marked *