Creating Hello World Windows Azure Node.js Web Application

Node.js is enjoying much popularity and Glenn Block is helping us to bring it on Windows Azure. In this tutorial, I will walkthrough step by step to create your first Windows Azure Node.js Web Application. I have divided this tutorial in three parts as installing required SDK, creating Web Application and then publishing to Windows Azure portal. Purpose of this tutorial is to help you in setting up environment and publishing. In further tutorials we will dig deeper.

Install Windows Azure SDK for Node.JS

To start with Node.JS on Windows Azure you need to install Windows Azure SDK for Node.JS. You can Get Windows Azure SDK for Node.JS from here. You need to install it from Web Installer. You will get below dialog box to install Windows Azure SDK for Node.JS


After successful installation, you should get below confirmation dialog .


By this  step SDK has been installed on your machine.

Create Node Application

To create Node application, click on Start and then select Windows Azure PowerShell for Node.JS. Run this as administrator


On command prompt create a Node directory in C drive as below,


After creating Node directory you need to create a solution. You can create solution as below,


I have created a solution called MyApplication. You can see files created inside the solution is as below,


There are four files created. If you are coming from Windows Azure background, you must be aware of other three files than deploymentSettings.json file. deploymentSettings.json file stores local setting for Windows Azure PowerShell deployment cmdlets.

Next you need to add a WebRole to the solution. To add WebRole execute below PowerShell command. If you don’t provide any name then by default WebRole name would be WebRole1. However I am providing name as WebRoleForNodeJS


Now if you list files created inside WebRoleForNodeJS , you will find configuration files and a JS file.


Most important file is server.js. This file contains starter code for Node.JS. You need to add codes in this file. Go ahead and open this file in NotePad. As of now, I am leaving default code created by the tool.


var http = require('http');
var port = process.env.port || 1337;
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello NodeJS from Debugmode\n');

Run Locally on Windows Azure Emulator

To run it locally, go ahead and execute below PS command to start Windows Azure Emulator.


You can see is running in emulator as below,


Publish to Windows Azure Portal

To publish it to Windows Azure portal, first you need to take Publish Setting. You can take that as below,


You will be redirected to live login page. Sign in to download Publish Setting file. After login you should able to download PublishSetting file. Download file inside Node folder you created in previous steps.


Next you need to import PublishSetting file as below,


Note : Publishsettings file only needs to be imported once on the machine to set it up. You do not need to do that each time you create a service.

After importing PublishSetting file, you can publish to Windows Azure portal as below,


In above command name is the unique name and location is one of the Windows Azure Data center. After successfully publish operation , you should able to see Node.js running on Windows Azure portal.


This is what all required to create first application. In further post I will discuss much deeper on the same. I hope this post is useful. Thanks for reading

7 responses to “Creating Hello World Windows Azure Node.js Web Application”

  1. Nice job Dhananjay! Just to clarify, the publishsettings file only needs to be imported once on the machine to set it up. You do not need to do that each time you create a service.

  2. Dhananjay Kumar

    Hi Glenn,

    Thanks for coming on my blog. I have updated blog with information given by you.

    Dhananjay Kumar

  3. Yes, very simple and up to the point post to get going with Node on Azure. Good work.

  4. Dhananjay Kumar

    Thanks Anoop 🙂

  5. […] Creating Hello World Windows Azure Node.js Web Application (Dhananjay Kumar) […]

  6. […] Creating Hello World Windows Azure Node.js Web Application […]

  7. […] Dhananjay Kumar posts: “Creating Hello World Windows Azure Node.js Web Application” […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at