Search code examples
azureazure-web-roles

Running node.js inside Azure Web Role


I have a very simple Nodejs app which runs on port 6647. I also have an ASP.NET app which runs on the normal port 80. I have a startup script which starts node.exe on deployment of the Cloud Service. It's working on my local compute emulator just fine. However, when I deploy to the cloud the role restarts a few times, and the port 6647 does not appear to be open. This is my configuration:

<Endpoints>
  <InputEndpoint name="HttpIn" protocol="http" port="80" />
  <InputEndpoint name="NodeHttpIn" protocol="http" port="6647" />
</Endpoints>

I have logged onto the server using Remote Desktop and Node is running and if I type into the browser

http://127.0.0.1:6647 

then I get a response from Node.

This leads me to believe that the load balancer has not opened up 6647 in-spite of the configuration above.

Anyone know why I cannot seem to run Nodejs alongside IIS inside an Azure Web Role (SDK v1.8, Windows Server 2012)? Works fine on my dev PC and my staging server (virtual machine).

thanks


Solution

  • Have you tried adding a startup task which opens port 6647 in the firewall? There's an example available here: Add firewall rules to VM’s running in Windows Azure (CSAzureAddFirewallRules)