简体   繁体   English

如何在Azure云服务项目中将Node.js Web角色与.NET Web角色一起部署?

[英]How to deploy a Node.js web role along with a .NET web role in azure cloud service project?

I have a cloud service with a web role in .NET. 我在.NET中有一个具有Web角色的云服务。 But I am also using socket.io for some functionalities of my project. 但是,我还将socket.io用于项目的某些功能。 What i have been doing all this while is that am putting the socket.io node.js file in the .NET web role itself and after publishing to cloud, am then doing RDP into the web role, installing the azure node.js SDK and then manually starting the socket.io server. 我一直在做的所有事情是将socket.io node.js文件放入.NET Web角色本身,然后发布到云中,然后将RDP放入Web角色,安装azure node.js SDK和然后手动启动socket.io服务器。 The biggest drawback of this technique was that whenever the roles restarted, i had to re install the azure node.js sdk and start the socket.io server again. 这种技术的最大缺点是,每当角色重新启动时,我都必须重新安装azure node.js sdk并再次启动socket.io服务器。

The only way I could find was by putting the socket.io node.js file in a separate azure project and publishing that using the azure power shell according to this link 我能找到的唯一方法是将socket.io node.js文件放入一个单独的azure项目中,并根据此链接使用azure power shell发布该文件

Is there a way to put both the .NET and node.js web roles in the same azure project and publish that to cloud? 有没有办法将.NET和node.js Web角色放在同一个Azure项目中并将其发布到云中? Or what is the best way to publish my azure cloud service consisting of a .NET web role and a node.js web role? 还是发布由.NET Web角色和node.js Web角色组成的Azure云服务的最佳方法是什么?

Thanks 谢谢

The development experience probably will be smoother if the Node.js component of the application is deployed as a separate cloud service instance. 如果将应用程序的Node.js组件部署为单独的云服务实例,则开发经验可能会更加流畅。 But it is possible to automate the deployment using startup taks as described in Run Startup Tasks in Windows Azure . 但是,可以按照Windows Azure中的“运行启动任务”中所述使用启动任务自动执行部署。

You can create a command batch file to download anything you need and install it on the instance. 您可以创建命令批处理文件以下载所需的任何内容并将其安装在实例上。 You can run it with administrative privilege. 您可以使用管理特权运行它。 You can listen to a port and have it set up as a cloud service endpoint. 您可以侦听端口并将其设置为云服务端点。 You can even deploy the files as part of your cloud service project and just configure and run them through the startup task. 您甚至可以将文件部署为云服务项目的一部分,并只需通过启动任务对其进行配置和运行。 Use RDS to debug this script via logging and system events. 使用RDS通过日志记录和系统事件来调试此脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM