1
votes

I have a cloud service with a web role in .NET. But I am also using socket.io for some functionalities of my project. 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. 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.

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

Is there a way to put both the .NET and node.js web roles in the same azure project and publish that to cloud? Or what is the best way to publish my azure cloud service consisting of a .NET web role and a node.js web role?

Thanks

1
Why can't you install the Node.JS SDK and start the necessary stuff from inside Azure role startup task or role OnStart()?sharptooth

1 Answers

0
votes

The development experience probably will be smoother if the Node.js component of the application is deployed as a separate cloud service instance. But it is possible to automate the deployment using startup taks as described in Run Startup Tasks in 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.