Using ProgramEntryPoint element in Service Definition to use custom application as role entry point using Windows Azure SDK 1.5

Part 1: Basics of running Nodes.js from command line:

You can download node.exe from the link below:

Now lets create app.js as below:

var http = require('http');

http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.write('<h1>Welcome. This is node.js page in Windows Azure</h1><br><br>');
res.write('<h2>Visit <a href="">Windows Azure</a></h2>');

Now launch nodejs server application as below:

  • C:\node-v0.4.12\bin>node app.js

After that you can open http://localhost:8080/  url with your browser to verify it NodeJS server is running:

Part 2: Using nodes.js in Windows Azure 

Now you can use the steps below to use nodes.js with Windows Azure:

  1. Create Windows Azure application with one Worker role
  2. Now you can include all of your nodes related files
    1. In this example you can just include node.exe and app.js (which you used above in Part 1)
  3. After that your can delete app.config and workerRole.cs as we are going to use ProgramEntryPoint elements released with Windows Azure SDK 1.5. Edit the following highlighted text in your Service Definition to run node.exe as worker role entry point application:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="AzureNodeJs15" xmlns="">
<WorkerRole name="NodeJsWorkerRole" vmsize="Small">
<Runtime executionContext="limited">
<ProgramEntryPoint commandLine="node.exe app.js" setReadyOnProcessStart="true" />
<InputEndpoint name="NodeJS" protocol="tcp" port="80" />

Now you can just package your application and then deploy it to Windows Azure. 

Many thanks to Nathan for his insight in his blog:

Comments (1)

  1. I like reading your blog because It gives me good information. I am new to Node.JS and want to know how I can take advantage of learning Node.JS with Cloud computing.