[英]Node.js Azure WebJob: How to deploy from Visual Studio Team Services with Continuous Delivery
We have an existing Web App in Azure that we are deploying a Node.js webjob to. 我们在Azure中有一个现有的Web应用程序,正在将Node.js Web作业部署到该Web应用程序。
We are currently deploying the webjob during the build (CI) process by copying the run.js and node_modules folder into the web app's app_data/jobs/continuous directory as per the only tutorial I found, then building and deploying the WebApp itself using CD. 当前,我们正在构建(CI)过程中部署Webjob,方法是按照我发现的唯一教程,将run.js和node_modules文件夹复制到Web应用程序的app_data / jobs / continuous目录中,然后使用CD构建和部署WebApp本身。
While this works, it seems a little hacky, and it takes a really long time to deploy the web app now due to the huge number of files in the node_modules directory. 尽管此方法有效,但似乎有点不合常规,并且由于node_modules目录中的文件数量巨大,现在部署Web应用程序花费的时间非常长。
Is there a more automated approach, ie deploying the node.js webjob to an existing web app? 有没有更自动化的方法,即将node.js Webjob部署到现有的Web应用程序? I can find all kinds of tutorials for this scenario re: asp.net projects but only the one for node.js webjobs, which is described in para 2 above)
我可以在以下场景找到各种教程:asp.net项目,但是只有node.js webjobs的教程,这在上面的第2段中进行了描述)
Update 更新资料
I am using the instructions in Amit's blog: http://blog.amitapple.com/post/74215124623/deploy-azure-webjobs/#.VyC06DArKHs 我正在使用Amit博客中的说明: http : //blog.amitapple.com/post/74215124623/deploy-azure-webjobs/#.VyC06DArKHs
Generally, if you are using Git to deploy your ASP.NET application to Azure Web Apps service, you can leverage npm manage file package.json
to install the node modules via deployment task. 通常,如果使用Git将ASP.NET应用程序部署到Azure Web Apps服务,则可以利用npm管理文件
package.json
通过部署任务安装节点模块。
You can try the following steps: 您可以尝试以下步骤:
package.json
file in your root directory path with the content including your needed dependencies. package.json
文件,其内容包括所需的依赖项。 https://docs.npmjs.com/files/package.json#dependencies . wwwroot
, then click Add
=> "New item", then under the Client-side
tab, select the NPM Configuration File
to add. wwwroot
,然后单击Add
=>“ New item”,然后在Client-side
选项卡下,选择要添加的NPM Configuration File
。 app_data\\jobs\\continuous\\testwebjob\\run.js
. app_data\\jobs\\continuous\\testwebjob\\run.js
You can directly require
the module, it will find the module in the node_modules
in root directory. require
该模块,它将在根目录的node_modules
中找到该模块。 Afterall, your root directory of your project will have the similar structure: 毕竟,您项目的根目录将具有类似的结构:
Any further concern, please feel free to let me know. 如有任何其他疑问,请随时告诉我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.