PhantomJS in Azure WebJob? [duplicate] - azure

I have deployed an asp.net mvc website in azure and I am trying to deploy phantomJS as a web job to support the web site.
I have uploaded a zip file with all the necessary dependencies to run PhantomJS and the web job starts successfully after running my batch file. The log reports that the server is up and running # 127.0.0.1:8080. However when I try to hit the PhantomJS app at url 127.0.0.1:8080 from my azure site hosted under someProject.azurewebsites.net it just times out with no other error message.
Specifically I am trying to deploy a phantomJS application that hosts a web endpoint (https://github.com/thelgevold/PhantomSnapshot) that will enable me to convert web pages to pdf if I pass a url from the website to the phantomJS process.
The website will pass a url to PhantomJS that will respond back with a pdf file that can be downloaded. I already have it working outside of Azure, but was curious if the PhantomJS process can be hosted as a web job
Does anyone know if it is possible to deploy PhantomJS in this manner?
I am running my site under the "free" configuration.

PhantomJS is not working on azure Webjobs.
I tried to execute it through CMD shell [yoursite].scm.azurewebsites.net/DebugConsole , but it hanges when I call it with raserize.js script.
you can use phantomjs as worker role, it will work.
Update
Regarding to this:
https://stackoverflow.com/a/23000040/3080500
phantomJS uses GDI to render images and pdf, and GDI is blocked in Azure Website
ref : GDI is not enabled in azure webisites http://social.msdn.microsoft.com/Forums/windowsazure/en-US/b4a6eb43-0013-435f-9d11-00ee26a8d017/report-viewer-error-on-export-pdf-or-excel-from-azure-web-sites
ref : PhantomJS uses GDI for rendering fonts : https://github.com/ariya/phantomjs/blob/6a01a8dece0c4dd697eaa0b208057d2bd43a30f3/src/qt/mkspecs/win32-msvc2003/qmake.conf#L63

We have the same issue with WSAS (Windows Azure Web Sites). We can run can communicate via stdin/stdout with phantomjs.exe, but when ever it does an actual network request, it will time out, or will freeze if a timeout is not set.
Some other applications can make network requests (f.e. curl.exe), but if you try running "ping", it will respond with "Unable to contact IP driver. General failure." googling which tells that there's likely a Hyper-V misconfiguration on their virtual servers.

Azure Websites will not allow you to listen on ports, also you cannot use localhost from within your Azure Website.

Related

How to deploy command-line program (exe) on IIS server?

I have a classical command-line program (exe), taking some parameters and doing some stuff.
I would like to make it accessible via internet, i.e. via web browser.
I have a Windows server with IIS web server and a running web site.
Is there a way to deploy this exe command-line program directly? Can it be embedded into existing web site? If not, what is the way to proceed?
If yes, how do I pass parameters to the exe program?
As far as I know, .exe cannot be deployed on iis server, because the web applicaion on IIS has to be configured to be able to run executables. if you want to run .exe through IIS, you can try it this way:
Make your web site write a file that indicates the process needs to
be run.
Write a Windows ervice that runs on the web server that watches for the file that your web site creates.

Azure Live Metrics doesn't show Incoming Request , Outgoing request, Server Health

I have followed below Microsoft documents to achieve Application Insights
https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-get-started?tabs=maven
https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-agent
https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-arguments
Just to give some background - My war is deployed in JBoss EAP 7 Standalone web server which is hosted in Azure Virtual machine.
But some reason I don't see Live Metrics at all, could you please guide how to enable ?
FYI - I can see all other metrics in AI
I used to create a springboot web application with app insights following this doc.
And when I finished the code and configuration, I run the program in local environment, I can reach the 'live metric' page. When I stopped the program, the web page showed 'Not available: your app is offline or using an older SDK'.
So according to your description, I think you can make sure if you have started the web container first. Or you can debug your program in local environment to check your code and configuration. If the program runs well locally and still can't reach live metric, try to modify the pom.xml and use a newer version.

Issues using Chrome-Pdf recipie on IIS

I am using the jsreport nuget packages in an asp.net core application. I am able to generate my pdf reports on my local machine however I run into an issue when I try to generate reports with the asp.net core application running in IIS. Whenever I attempt to run a report, it ultimately times out and gives me the following error:
Error rendering report: instance has been daemonized and initialized successfully (pid: 2480)A critical error occurred while trying to execute the render command: Timeout Error: pdf generation not completed after 40000ms
Some information about my setup:
The app is being hosed in IIS on a Server2008R2 machine
The IIS app is running under the Network Authority user.
I have given the application pool full permissions on the jsreport
folder deployed with the ASP.Net Core application.
I have give the application pool full permissions on the jsreport
folder in C:\Windows\Temp
Here is what I have been able to verify so far:
I can navigate to the jsreport folder in the deployed asp.net core
application, run jsreport start from the command line and enter
jsreport studio. From there I can run my reports with sample data
sizes comparable to what I would expect at runtime, and they export
to PDF just fine.
I can successfully make a request to the IIS hosted asp.net core application to render a plain HTML report.
The reports run just fine when being hosted on my local machine, outside of IIS.
It seems like there is some kind of issue with IIS accessing Chrome and doing the pdf conversion. Are there any additional steps I need to take to get chrome-pdf conversion working when hosting with IIS?

How do I host a long-running task on a Windows web hosting?

I'm having a smarterasp.net windows web hosting. I need to have a service that runs permanently and periodically parses a specific remote website, writing results to a log file. I have created a windows servcice, but how do I host it on my web hosting? Running exe files is forbidden, as well as SSH.
Any help? Thanks.
As far as I have found out, it's often impossible to run a windows service on a web hosting, like in my case. One of the possible workarounds in hosting a background process in the website process, specifically by utilizing things like hangfire.io

msdeploy mvc to Windows7 getting ERROR_DESTINATION_NOT_REACHABLE and 404

I'm trying to do msdeploy of a MVC app to a windows7 box, running on command-line. And kept getting this error:
Error Code: ERROR_DESTINATION_NOT_REACHABLE
More Information: Could not connect to the destination computer ("192.168.xxx.xxx"
). On the destination computer, make sure that Web Deploy is installed and that
the required process ("The Web Management Service") is started.
Error: The remote server returned an error: (404) Not Found.
Error count: 1.
I've verified both Wmsvc (seems this is being used) and MsDepSvc are running. And firewall are disabled. In the browser when I visit https://192.168.xxx.xxx:8172/msdeploy.axd, I got a Server Error 404, seems a bit further than where the command-line stopped.
Most of instructions on setting up IIS7 and Web deployment I could find online is for MS Servers. Both my local machine and the Windows7 machine has the same version of Msdeploy installed.
I had exactly the same issue with a VM on Azure, and the solution was to enable first the IIS Management Service and then install Web Deploy (I used Web Platform Installer). Seems that the installation order matters. You can find a blog entry I wrote about this here http://davidjrh.intelequia.com/2012/10/configurando-web-platform-installer-y.html
For non-server operating systems (i.e. Windows 7) the Web Deploy publish via Web Management Service is not supported. Instead you will have to use the Remote Agent Service, this is an admin only publishing service. You can find more info at http://technet.microsoft.com/en-us/library/dd569059(v=WS.10).aspx.
I had the same issue using MSDeploy to deploy my web application to remote IIS 7.5 web server running windows 7. I have just figured out how to fix the problem today after reading Sayed's post, so I wanna post my solution here for anyone who would run into this problem like me. Try this:
Enable IIS Management Service (in control panel >> add or remove features >> add or remove windows features)
Install Web Deploy (http://www.iis.net/downloads/microsoft/web-deploy)
Open cmd with Administrative privilege, type “net start msdepsvc” to start the “Web Deploy Agent Service”.
Check this link in your browser: http://serveraddress/MsDeployAgentService/, if it prompts for username and password, MsDeployAgentService is running on server, go to the next step.
In VS, type in http://serveraddress/MsDeployAgentService/ in Service URL while creating publish, instead of https://serveraddress:8172/MsDeploy.axd, and click test connection. It should be ok now.
After checking the Management Service and Web Deploy 3.0 were correctly installed, I found that (from VS2012 at least) the Service URL seems to matter here too, attempting to publish to any of the following did not work for me:
FQDN (localmachine.domain.local)
Domain IP Address (172.22.xxx.xxx)
Loop-back IP (127.0.0.1)
Whereas the following DID work:
localhost
NetBIOS name (localmachine)

Resources