While Azure App Service Web Apps has many Node.js versions preinstalled, it also allows for an user-provided Node.js binary. This article discusses two methods enabling the use of io.js on App Service Web Apps: The use of an extended deployment script, which automatically configures Azure to use the latest available io.js version, as well as the manual upload of a io.js binary.
Using a Deployment Script
Upon deployment of a Node.js app, App Service Web Apps runs a number of small commands to ensure that the environment is configured properly. Using a deployment script, this process can be customized to include the download and configuration of io.js.
The io.js Deployment Script is available on GitHub. To enable io.js on your web app, simply copy .deployment, deploy.cmd and IISNode.yml to the root of your application folder and deploy to Web Apps.
The first file, .deployment, instructs Web Apps to run deploy.cmd upon deployment. This script runs all the usual steps for a Node.js application, but also downloads the latest version of io.js. Finally, IISNode.yml configures Web Apps to use just the downloaded io.js binary instead of a pre-installed Node.js binary.
To update the used io.js binary, just redeploy your application - the script will download a new version of io.js every single time the application is deployed.
Using Manual Installation
The manual installation of a custom io.js version includes only two steps. First, download the win-x64 binary directly from the io.js distribution. Required are two files - iojs.exe and iojs.lib. Save both files to a folder inside your web app, for example in bin/iojs.
To configure Web Apps to use iojs.exe instead of a pre-installed Node version, create a IISNode.yml file at the root of your application and add the following line.
In this article you learned how to use io.js with App Service Web Apps, using both provided deployment scripts as well as manual installation.
io.js is in heavy development and updated more frequently than Node.js. A number of Node.js modules might not work with io.js - please consult io.js on GitHub for troubleshooting.
- For a guide to the change from Websites to App Service see: Azure App Service and Its Impact on Existing Azure Services
If you want to get started with Azure App Service before signing up for an Azure account, go to Try App Service, where you can immediately create a short-lived starter web app in App Service. No credit cards required; no commitments.