Node.js App on Windows Azure BDV TechThursday, Jun 26, 2014 a@dycode.com | @andri_yadi | http://andriyadi.com
about me
CEO of
a movie freak movreak
start up companies for 10 years 15 years in software development
6 years in a row 1 of 2 Azure MVPs in Indonesia, 
 of 114 in the worlds
The first & largest iOS & OSX developer community in Indonesia ID-ObjectiveC President
Focus on Demo :) Disclaimer
Only 5 years old But seems everybody use it!
Node.js on Raspberry Pi
A platform with event-driven, non-blocking IO model, built on Chrome JavaScript runtime What???
Event-drive Non-blocking Asynchronous I/O Model
De facto language for the web Event-driven Node.js = JavaScript on server JavaScript
Chrome’s JavaScript runtime V8 is really fast It’s (sort of) compiled V8
var http = require('http'); http.Server(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(3000); HTTP Server A simple standalone working HTTP server Web development from the scratch :)
Built-in modules Third-party (> 80,000) Build your own :) Highly modularised
Node Package Manager NPM
Install Node.js from pre-built installers, or build from source code
 http://nodejs.org/download/ Get started?
Enough slides! 
 Show me some code Your wish is my command
Real-world web development should use this module! ! npm install express ! or if you’ve installed express-generator module, 
 just type: express Express
More code please! Your wish is my command
To Do List demo
Enables real-time bidirectional event-based communication ! npm install socket.io ! *Socket.IO 1.0 is different than 0.9.x. Make sure to read migration guide. Socket.io
Change prev demo with Socket.IO
on “connection” event “alltasks” event “addtask” event broadcast “newtask” event “completetask” event broadcast “taskcompleted” event Socket.IO realtime events No need to post data via HTTP POST!
Node.js on Windows Azure What???
Among other things, Azure provides:
Some of Azure Service...
Supported Web Frameworks Or any custom FastCGI Handler For you, web developers
So, how to deploy Node.js app to Windows Azure? I use Mac as development machine :) Disclaimer
azure-cli is your friend npm install azure-cli -g Azure-CLI
Get Azure account. Buy or free trial :) ! Login to Azure and select subscription (if > 1): ! azure account download azure account import <file> azure account set <subscription> Deploy Node.js on Azure Website
Creating website from current directory: ! azure site create —-git git add . git commit -m "First Commit” git push azure master ! That’s it! Deploy Node.js on Azure Website
More detail articles: • http://azure.microsoft.com/en-us/documentation/ articles/xplat-cli/ • http://azure.microsoft.com/en-us/documentation/ articles/storage-nodejs-use-table-storage-web-site/ ! There’re more options to deploy Node.js to Azure. Just check here: http://azure.microsoft.com/en-us/develop/nodejs/ Deploy Node.js on Azure Website
Get your hand on iOS 8 
 or Node.js? Let’s join upcoming iOS 8 & Node.js development class! More info: 
 http://dycode.co.id 
 edu@dycode.com ADS
Discussion
Live demo http://intro2node.azurewebsites.net/ I’ll keep alive as long as possible :)
Source code https://github.com/andriyadi/ NodeAzureStorageSocketIO To run, follow instruction there. Good luck :)
a leading mobile & web apps developer, an early adopter, an award-winning company
DyCode www.dycode.com office@dycode.com @dycode

Develop & Deploy Node.js app on Windows Azure