PhantomJS 作为 Azure 中的 Web 作业 [英] PhantomJS as web job in Azure
问题描述
我已经在 azure 中部署了一个 asp.net mvc 网站,我正在尝试将 phantomJS 部署为 Web 作业以支持该网站.我上传了一个 zip 文件,其中包含运行 PhantomJS 所需的所有依赖项,并且在运行我的批处理文件后 Web 作业成功启动.日志报告服务器已启动并运行@127.0.0.1:8080
.但是,当我尝试从 someProject.azurewebsites.net
下托管的 azure 站点中访问 url 127.0.0.1:8080
上的 PhantomJS 应用程序时,它只是超时,没有其他错误消息.
具体来说,我正在尝试部署一个托管 Web 端点的 phantomJS 应用程序 (https://github.com/thelgevold/PhantomSnapshot),如果我将网址从网站传递到 phantomJS 进程,这将使我能够将网页转换为 pdf.
网站将向 PhantomJS 传递一个 URL,PhantomJS 将返回一个可以下载的 pdf 文件.我已经在 Azure 之外使用它了,但是很好奇 PhantomJS 进程是否可以作为 Web 作业托管
有谁知道是否可以以这种方式部署 PhantomJS?我在免费"配置下运行我的网站.
PhantomJS 不适用于 azure Webjobs.
我尝试通过 CMD shell [yoursite].scm.azurewebsites.net/DebugConsole 执行它,但是当我用 raserize.js 脚本调用它时它挂起.
您可以使用 phantomjs 作为辅助角色,它会起作用.
更新
关于这个:https://stackoverflow.com/a/23000040/3080500
phantomJS使用GDI渲染图片和pdf,Azure网站屏蔽了GDI
ref:Azure 网站中未启用 GDI 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 使用 GDI 渲染字体:https://github.com/ariya/phantomjs/blob/6a01a8dece0c4dd697eaa0b208057d2bd43a30f3/src/qt/mkspecs/win32-msvc2003/qmake.conf>#Lp6> 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 @ 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. 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 这篇关于PhantomJS 作为 Azure 中的 Web 作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!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.Update