Web API, Azure and Crystal Reports  Topic is solved

Discussions relating to the REST API of Jiwa 7.

Web API, Azure and Crystal Reports

Postby SBarnes » Wed Jul 04, 2018 10:40 am

Hi Mike,

Given the Web API now includes an example of exporting a report to PDF from Crystal and sending it back through the API will this actually work if the API is hosted on Azure given that Crystal needs to write the report out to disk?

Also does the Crystal run time get deployed to Azure in the IIS version of the API?

Thanks.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1621
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 176

Re: Web API, Azure and Crystal Reports

Postby Mike.Sheen » Wed Jul 04, 2018 8:45 pm

Hi Stuart,

We used to have api.jiwa.com.au hosted in Azure as an App Service - which is the managed IIS offering Azure provide. That all worked - including using Crystal Reports to generate reports until we released 7.1.1.

7.1.1 used a newer Crystal Reports engine version - SP21 - and after deploying the 7.1.1 version of the api to the Azure App Service we got problems relating to Crystal Reports - the service would return errors relating to Crystal Reports not being deployed correctly. I didn't spend much time on troubleshooting that, and instead moved api.jiwa.com.au from the Azure App Service to a self-hosted environment which we could install Jiwa on, and the problem went away. We also found some significant performance improvements by doing so (like authentication went from 10s to 2s).

I'm yet to revisit this and work out what we need to do to get the Jiwa 7.1.1+ REST API deployed to Azure App Services such that it works - from memory the problem relates to Crystal now demanding some of it's components to be in the GAC, or possibly some registry key entries to be present - which is not something you should really do with the Azure App Service (think of it as container-like service, multiple instances can be spun up on demand - so nothing should be "installed", just files present).

We've not given up yet - I think we might just need to deploy some additional Crystal assemblies which we didn't have to before, or maybe perform some Assembly Resolution redirection magic - we'll work out in the next few weeks if we can do it and how.

Mike

PS: In other news phase I of API Key authentication is going to make it into the next DEV build! :D
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Web API, Azure and Crystal Reports

Postby SBarnes » Wed Jul 04, 2018 9:12 pm

Hi Mike

How are you deploying the self hosted option under Azure as if the performance going to be better I might try that option?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1621
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 176

Re: Web API, Azure and Crystal Reports

Postby Mike.Sheen » Thu Jul 05, 2018 7:56 pm

SBarnes wrote:How are you deploying the self hosted option under Azure as if the performance going to be better I might try that option?


We're not - we're actually running it as a VM on-prem in our office - but a VM in Azure with Jiwa installed and the Jiwa API service configured and running would achieve the same result. If your database is an Azure SQL database, you're probably already using a VM for RDS, so you could run the Jiwa API service on the same box.

But, like I said earlier, we are going to troubleshoot this some more and hopefully work out the kinks to have it running as an Azure App Service.

Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Web API, Azure and Crystal Reports

Postby SBarnes » Thu Jul 05, 2018 8:12 pm

Hi Mike,

I had assumed you were using a VM but wanted to be sure you weren't using one of the other Azure Services.

On the Crystal front I have read some stuff on deploying the crystal run time in Azure as part of a web app but I get why you want to use the file drop approach.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1621
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 176

Re: Web API, Azure and Crystal Reports

Postby SBarnes » Mon Jul 16, 2018 7:19 pm

Hi Mike,

Is this issue with Crystal and Azure likely to be looked at for the production release, as certain fairly large customer that we have discussed before who we are developing a web store for are currently examining the possibilities under Azure/Cloud?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1621
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 176

Re: Web API, Azure and Crystal Reports

Postby Mike.Sheen » Mon Jul 16, 2018 10:45 pm

SBarnes wrote:Hi Mike,

Is this issue with Crystal and Azure likely to be looked at for the production release, as certain fairly large customer that we have discussed before who we are developing a web store for are currently examining the possibilities under Azure/Cloud?


I'll be looking at this sometime this week - I don't know yet what it'll take - will know more in the next day or two. So - to answer the question, yes it will be looked at - I'm fairly confident we'll have this in 7.2 (the next public release)

Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Web API, Azure and Crystal Reports

Postby Mike.Sheen » Tue Jul 17, 2018 7:23 pm

I had a crack at this for a few hours today - we're closer, but not there yet. You can follow our shenanigans on DEV-6765.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Web API, Azure and Crystal Reports  Topic is solved

Postby Mike.Sheen » Sat Jul 21, 2018 9:48 pm

I'm backtracking now on my statement of confidence that we can do this for 7.2.

An Azure App Service cannot be used to host the Jiwa API.

The Crystal Reports runtime must be installed in the environment hosting the Jiwa API - as it demands a certain registry key entry to be present (and possibly other requirements) - but as you cannot create registry keys on Azure App Services, it is not possible to have the Crystal libraries work at all.

What is required by Crystal Reports is the registry entry of HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Common Files to be the file path of the Crystal assemblies/files. On a Windows machine with Crystal Reports for Visual Studio, Developer Version installed that would typically be C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86

A Crystal Assembly checks that registry entry and if not present throws an exception upon instantiation:

"An error has occurred while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key permissions are insufficient, or the Crystal Reports runtime is not installed correctly. Please install the appropriate Crystal Reports redistributable (CRRedist.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/support for more information"

We cannot add registry entries to Azure App Services, nor can we intercept application access to the registry to return a value as a proxy, and nor can we create the registry entry in code.

If you are hosting the Jiwa database in Azure SQL, then the API must be either the self hosted API service on a Windows VM in Azure, or an IIS site on a Windows VM.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Web API, Azure and Crystal Reports

Postby SBarnes » Sat Jul 21, 2018 10:18 pm

Hi Mike

do either of these links help as a possible work around even though I know you were aiming for the file drop method?

https://www.codeproject.com/tips/1135525/running-crystal-report-in-azure

http://www.britishdeveloper.co.uk/2012/01/crystal-reports-on-azure-how-to.html
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1621
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 176

Next

Return to REST API

Who is online

Users browsing this forum: No registered users and 1 guest