Running io.js on Azure Websites


io.js temporary logo

Download the io.js binary

io.js can be downloaded here : https://iojs.org/download/

You just need the iojs.exe file itself which you can get from the nightly builds, for example:

https://iojs.org/download/nightly/v1.0.0-nightly2015011284fa1f8c46/win-x64/

Place this file in a bin directory.

Configuring Azure

To tell Azure Websitest that you want to use this version of node, rather then the version supplied by Microsoft, add a iisnode.yml file, with this line:

nodeProcessCommandLine: "D:\home\site\wwwroot\bin\iojs.exe" --harmony

note I’ve added the --harmony flag to enable generators.

Create a Web Server

Now just create your node app in the usual way, to start with you could write out the node version over HTTP:

var http = require('http');

var server = http.createServer(function(req, res){
	res.end(process.version)
});

server.listen(process.env.PORT || 8080);

Deploy to Azure in the usual way

$ git init
$ git add .
$ git commit -am "intial commit"
$ azure site create
$ git push azure master

Note that your web server will run using this version of node, but npm and other build steps will use the version supplied by Microsoft.

Next steps

To make it easy, I have publised an example project on GitHub.

To make it even easier, I’ve add the ‘Deploy to Azure’ button, to get you going really quickly.

Deploy to Azure