 Well it reads no.js with windows and windows azure. So what does that bring on to the table per se? So the first things, the first couple of things basically I would like to understand how much rather I would make it's not a guess it's much much more than I guess I'm sure most of you all of you would know what is no.js. that you know it much more than I do. So really the session is to bring to focus that no.js is available on windows all of you know that yes and it's also available on windows azure. So setting one text like to understand you all are familiar with windows azure platform not really and above the node and sure yes. So you tell me what is your motivation for coming to the session what do you want to understand how do you install it, what are the APIs available, how do you work with node or what really do you want to So easy to what VM image would you have still you anybody already worked with node on windows So let's start really just a reason to give context as to node for example a windows developer .net developer they might find very weird why do we even need integration what is node bring on to the table I'm not going to go through this you all probably know what you know the programming So in healthy runs of the v8 runtime your app will use multiple modules which you will install using the npm package manager and if you make use of those you can write your own modules and you set your roots or you can use other things like So node is pretty much excellent for pooling kind of operations for web application development per se Well not so for CRUD operations ok types because really it's driven by even so you know all of that Definitely not very good for highly grid computing sort of you know compute intensive computational scale so I'm sure you know that So let's get on to what we're here to look out for right So node.js on windows came out in week or couple of months back and kind of got stabilized So if you go to node.js.org you have a download section and you probably seen this family you have a download for windows So when you go ahead and click the windows download it's going to install couple of components It first installs the node.exe for your windows optimized It also installs a handler for is called isNode it's a native module which helps you to leverage the capability of is as we shall see as well So I'm not going to run this because it's already got that installed which is what you guys know that it will do that And also it installs the npm that is the pack node package manager for you to go ahead and download the other module set for you Yes it's compatible for 7.0 7.5 It is from 700 So in fact if you go ahead and install the through the portal to go ahead and install the node.exe and your isNode You can probably go ahead and you can in fact when you install that you'll also probably get a sample thing which you can go and take a look at That's something what I have here I just want to highlight this before we go on So it will go and install pretty much what you have to do is in your web.config of your file you will set a path to say Let me open up a simple web.config here that you see If you see it will have a path with the modules as isNode so you can always set rules and path going to be handled by isNode And how will it actually do that? So you have the is and any request that comes to is will go check with what is the handlers in the modules that it will get routed to the isNode And what does isNode do it will go and try to attach itself through and IPC to various node.exe Which means that it kind of leverages the IS capabilities of say load balancing across multiple things So if you have multi-core processor how can you leverage all the cores versus a node.exe single threaded Confidence you basically will spin off more node.exe and manage all of that So all that is taken care by the IIS so that is something which is inherent In fact the documentations will give you these samples and as I said you have multiple samples Like how you just go and start off with the hello world on the node For example when I see explore just has pretty much hello.js file So if you just see this file it has nothing fancy For example call the HttpModule3HS server has a request and response And the response is hello world and just prints probably the version of the node that you have etc So and if you see the web.config file here You see that it all it has is the handler that's pretty much So here we can also go and then browse this app And for example it doesn't have a default setting So that is why I think it's hello.js So if you see we are able to access it So it's wiring up to IS and running it has become like really easy with node So that's one thing which I want you to highlight And similarly if you take a look at the other confidence how you said How can you enable express through the node package manager So let's go on and try to give you some context on windows azure and what So quickly what I was trying to show you here was how IS can Help developers to enable process management scaling to multi-codes For example auto updates so what really IS does is you make any Once you have it hooked on to your virtual directory in IS Whatever changes that you do will get automatically If it sees that there's any change with the js file It's going to take that up and automatically execute that So you don't need to stop restart etc So that is taken care of and the logs over http can be seen So how it was developed Primarily it says that there are very minimal changes to the node.exe Which was done to pull to windows So that is to say that you will pretty much all the functionalities That you have currently is available on linux It's available on windows as well So in fact if you see all we did is we had a js file And in our web.config which is the configuration file For a .NET IS to identify where to root the various file You just put on a handle which says If it is whatever path you get set start Or give it a particular expression kind of thing And in this case you would call the modulize node So then it gets routed to that So now we will do the second half of the discussion Which is on node js on windows as well So for that I would want to pause a bit And go on to a single portal In fact if you want to take back one thing about windows azure Today it will be just this windows azure.com You can go ahead and get all the information on Microsoft's windows azure platform from this portal So windows azure is supposedly called the cloud operating system Frankly it is not an operating system on the cloud It is more like operating system services on the cloud Which means that you can do a lot of things Today what we see is how do you go ahead and deploy your Applications they could be applications hosted on IS Web applications WCF or services Or there could be background applications back in the Confidence et cetera So how can you go and host all of that So really one part of the windows azure is like a Hosting provider so if you don't have your hardware Or you don't have the infra you can use the windows azure But the windows azure as your in its glory is really Much much more than all of this It has various independent services that it can provide In services in terms of data on the wire So you can publish data, you can subscribe data On the wire If you want to do something like authentication Authorization through claims based Which is another important happening concept Now claims based authentication across technology You want to do all of that You can there is something in windows azure For the actual customer service And there is a virtual machine role So for example you have a VHD You want to just upload the VHD You want to use something like the EC2 But truly speaking you still don't have it persistent So there is some fancy around it So it's not really a virtual machine Which is given to you So all that is windows azure platform So talking about the windows azure platform I'd like you to probably take back one basic thing Which is like frankly it could be a marketing job In to say windows azure is operating on the cloud But what do we really mean Or translate it to an operating system So an operating system will do some basic tasks Like what if food.exe it executes food.exe The food.exe can be hosted on IAS It could be hosted as a bank process Bank or process anything So this component what we are here to see Is really using that part of the operating system But why do you even want to do that What is your motivation to move to cloud Why do you There is a lot of buzz today And there is a lot of applications being put in But why have they also invested a lot of time For node.js on windows azure Obviously because node is something Which is although it's time It was developed like what MIT The joint way back in 2009 But still today it's something Where they see a lot of value With a lot of applications built on it etc But the real essence of windows azure Is to say that you have An operating system capability on the cloud Which means you can give your application Run and execute But today from 10 The servers or 10 instances If you want to scale up to say 100,000, 10,000 How easy it is to do a turnkey Scale up today in the current scenario As opposed to on the cloud So in fact there are four main companies Who are big words in the cloud space Like Microsoft Representing Microsoft So I am saying that There is Google with Google apps There is Amazon Obviously with the EC2 And S3 And other companies There is other players like the VM Where they are all coming up But then HP is also said to be one Who are assimilating a lot of these Hardwares trying to build their own clouds So it's like a very thin terminology When you say there's a public cloud There's a private cloud, hybrid cloud Any question? So today when we see So that motivation I hope it is clear right Why are we even talking about Node.js on windows azure Windows azure provides Certain operating system capability One of the capability is You're able to execute some .exe whatever be it What does that cloud What does that operating system Or your desktop should provide Definitely should provide Certain abstract data types For you to watch Those could be Your flat files, C drive Symbol tables For your queues For messaging So it provides all these Abstract data types As storage confidence As service So then they just call it Like storage service So you can get your blocks It's called blocks Which binary large objects You can get your tables Which is more like a one-in-f table It's not like a relational table You have to manage Transaction current So it just gives you those Data structures over the wire And I call it this Now can Node use all of these? Yes So that's what we're here To see which is A Node can use These services That is provided Node can you can Write an application And deploy it on That you can do So it does these things Also does certain other things Like the basic operating System capabilities Of resource management Disaster recovery Scheduling All that is taken care By the Ethernet Windows Azure And we are not really bothered Or we are not able To discuss about this Okay So what if you are I'm sure As we got from the poll All of you are Very used to the Windows Azure world So you could just Go click on develop And then you'll see A bunch of technologies Which have Out-of-the-box Support to Windows Each component Of the Azure At this point Might be very Unclear to you But let's just take We want to post Application We want to use Some data Abstract data types Which are available As a service So it's got an HTTP Rest endpoint Which you can consume Now once you Have an HTTP Rest endpoint You can build Rappers around So the Rappers have been Built obviously For .NET For which You can use Visual Studio Rappers There are Rappers also Which have Now been built For .NET.js So that's Something that you Want to know So when you click On .NET.js It allows you To go and Download and Install So when I Install this What does it Really install So it will Launch something Called a Web platform Installer Which I'm not Will to show You fully But you can Just go To the dependencies That you might Want to go Installing One by One Confident You can go ahead And install All of them So it will Go and install Your Node.exe On your machine It will Install IS Node On your machine It will Go and install The LPL Package Manager on your Machine It will Go and install Something called The Windows Commandlets For Node.exe How many of you Any of you Are familiar With the PowerShell Commandlets? So you Can do this And you Can go and Just search For Node So it will Go and Pull out All the Confidence That you Might want To install For Node So if You see These are the Things So if You add Multiple To show You Something Concrete You will probably Need to Get a quick Hand of What does it take To run an Application On Windows Azure Right So let's see If I have Some tech on it So when you See any Application On Windows Azure Which is the Cloud Operating System From Microsoft Applications Separate Directly As a Process So if you Run on IS It's just a Terminology And if it Runs Outside of IS That's all it is So only Two types of Roles that Run on Cloud The Web And the Work Which means On Node.js You can Use it As running As a Operating And you'll be Using all the Features of IS So you can Create a web app Or Directly Call Node.exe The Worker So what What if I have Web role and I Don't Use The STD Module at all I don't Listen to Any word I just Put it up So what does Your Web Roles So what What does So how does The Azure Work It will hook up to HTTP At 480 As your Default page And But if there is No HTTP Server Listening At all Then From the Azure World It will Allow the Node Application To run But there Will not Be Any I could I mean If I don't Want my Code to be Listening to 480 Or any In the Base I could just Not Use that You could just Not You would Run As a Worker role That's What I could Use the Web Why Why Why Why Why Why How do I Do that Those are the only two ways That you can Probably Create Any Service or application Either you want to deploy An IS Use the IS For IS You have the IS Either If you don't Want to do it Directly Node.exe will be Understand The question was Do we Really need Yeah Right Why That's the whole Part No Okay You are not using The multi-code You are not using All In either case You will In either case You will Even if you use IS You still Spawn Yeah You will So The IS node Will spawn Just not one But multiple It will load Balance Multiple All of that Will do It will also Take care Of auto Updates That information Let's say I am sharing Global state In my application If I was Developing for Linux I don't have to worry Because it's a single Related application I move to Azure And spawns Five of them In the state There is no Common state How do How does the Information share Then I need to Bring in Some kind of IPC Can you use The state Service For the Okay That's IS talking to them Yeah Now If you're Creating an application For cloud Be it not just Any cloud For that matter EC2 is A little different Because you get A Linux machine Your system admin Any platform As a service Your Architecture Should be Stated That's Another story I mean It's Some person Beginning with this Might You could do is Because those are all Configured My question is Can these Instances communicate With each other They share information They can communicate With each other You could use I mean You could use I don't know Distributed cash Service And cash Whatever My question is Does IS tell you How many instances There are You tell IS So you Go and configure That you want Five instances Or one instance Right Because if you Now say that I want this To be Developed And five instances That means Five virtual machines Will be good Each of them Will have their separate IS This is going to be Developed So you Can't make a communication Or the state Is by the Knowledge of cloud It's not Talking from One to another But within An IS Within the Radius Node.exe Is spawning The roadbans are taking care Yeah Okay So we were saying That there are two roles We said there is web And so this is what We said Web role is IS Which will Direct to the IS Node Which will spawn Various Node.exe Is based on The worker role On the other hand What really Happens at the Worker role There's something called The node entry point Which is the entry point For any worker Role And that entry point At the node entry point And as soon as The node entry point Happens It calls the Node.exe Normal case What happens If you're writing on .NET Or any other There are other things Such as You can say When Node Recycle Or create Something called Node entry point .run Which means That It'll execute that Code as a loop Calling one another So you can have Instead of Any other process ends Does it Recycle it Or does it Recycle it No, no, no Recycling of The role Keeps on happening So for example If you've written bad code And it crashes It will keep Recycling them So let's Go and See how Do you go And probably Quickly develop Something on it First and foremost As I said WebPI Will allow you To install A couple of Confidence Otherwise you can Have Repository For Microsoft Confidence And this has PowerShell Commandlets For Windows Azure So you can Go and Search for PowerShell Commandlets So basically You can go Find that there And then You can install The PowerShell Commandlets And once you Do that You can Go and Take a look At Node PowerShell So you PowerShell For Those of you Who Don't know It's Again It's like Very It's like a scripting Thing For Microsoft developers So you can You have Various confidence Add-on Which has For example You want to Create You have a project You're putting it On production You want to Script the deployments For every Thursday Far easier To do The PowerShell Scripts It's got Its own modules Commandlets Commandlets A bunch of commands Which will be Segregated as one name So you can Go and Execute it If you go to Something Like what You can do Something Now that We have this Windows Azure PowerShell Commandlet You can go And say Hey Let's go Start Here you can Go and say Create a new Azure project So if you say Hey This is a new Azure project And just give it a name So Here what it does Is it creates The basic templates For you to do So let's go To this Location here And see What it has The border Cheers Hello So it says That it has The framework What is it built It's got some XML file Forget about the extension It's got a Configuration file And a definition file So The real Cloud Which is Here Which I don't think The actual Quarter of the Cloud is Windows.azure.com So if you Go to the Windows.azure.com Today you need to Sign in With a Live ID Or a Passport ID Once you sign in See here And you have these Various Confidence which you Have access to Like you have a Database on the Cloud which is Called the SQL Azure You have Data sync You have Reporting on the Cloud You have Something like You asked about Cache There is a Caching service On the Cloud Etc. There's also the Confidence that We have Bothered today Which is Personal account This is my Official account So it's like If you have an Account you can Make someone a Co-Admin and they Have the exact same Rights that you have And you can see Multiple So Which means that For example I can open up One account here And say That this Account has Multiple Projects Which have been Deployed to it This means that I have Each of these Projects For example Because Anything that Just It's just again Anything that You can Get from the Cloud over Http or on the Wire It's Supposedly called A service So I call this As a service Which means That this service For example Here that you see Is called The JS food demo Is what the Service is called To say Now this service has A URL Which is By default And it also has Multiple roles That we saw In this case it has Two roles One is The web role The other is A worker role You can have Multiple web roles You can have Only worker roles You can have Any combination Right So How does The hierarchy work First is Your Service It's just called A service Within service You go and Create roles So you might have One module You can put it As a web role Collection You can put it As a worker role For example Whatever you collect You want to Turn it into Process Put it into storage That you want to do As a worker role You can do Any configuration So And each of these Are independent Of each other State wise And other So That we said Now we want to Create Or deploy an application So first We can go And say A service name This is A unique URL Which you need to Give it This is when you're Creating a service So you can Go and give it A unique name Saying If it is already Taken It can flag you Otherwise You can go Now the windows As your Again As the title Also said Scalability Is something Really Important In fact That's One major Advantage For windows Across Geography As you say Currently you have it In all these regions Closest to India Is probably Singapore Hong Kong So you can go And choose Also Apart from this You have CDNs Which are Also Is a separate thing Which you can Subscribe So basically If you want Something in India Something in Mumbai For Pune You can Try to Work Now once You give Two Basically Two Example Kind of Files One File is called A configuration File It's just A configuration File To say Hey I want Ten instances To be Deployed I can Change it Without redeployment Ten becomes 100 tomorrow I just Have to change The configuration File To the Windows Azure SDK Because That will give you The SDK For you to package Your load application Into The form That you can Directly go and upload Right So If you upload These two And say Okay You will go And You will Provide So That's about it Yeah I think The queue Wouldn't be Much Queue Everything would be There are A lot of NPModules That Are Nated by Things Like GOIP module Is there And High Redis For Redis Is there For those modules I mean They don't compile Or NPM Yeah They don't compile The Windows Yeah So Microsoft Also trying to Do something With the Popular modules And Which packages Are working on What's going to come out The roadmap And so on But there is There's a node There was a lot of Node and There was a lot of initiators Of Microsoft Yes Yeah Active development is There In fact All of these Are open source IS node Azure SDK And they are posted on GitHub They can I can look at the source For them as well You know But They're Serving Azure They don't look like clients So for us For Windows Azure We try to talk like But you need to Give me your credit card And today But you won't be charged I'll give you my credit card It's easy to make the instance You'll have to But you won't be charged But you won't be charged For 30 days Yeah And no spending limits So For example For 30 days If you leave your instance By mistake on Previously In fact Before Last December 12th Or 13th For so many hours So by mistake You forget To switch off your instance For example As you see on the portal These instances Are in the running state Right It says ready I can Go ahead And say The lead stop Etc So if you forget To do that That means Virtual mission Is being provisioned For it So If you do that Then you Overcharge If you exceed The limit But now The application For example See Here's the demo So here's the For example There is an application Which has a web role And a worker role I said web is something On IS And not on IS So if you see There are two One is So the application is like This You want to track Some stock quotes Of 3, 4 Things Microsoft, Apple Google Intellect And Just randomly Generating a number Of quotes And And this is done As a worker Or a background Process This quote The background Process uses The windows azure Table storage To put that Data on the table The web front end Checks for the last 10 seconds What is data Has come on the table And displays the data Just see this Run And then I will Probably So You know That You know That What This is the node azure sdk Yeah So as I told you As we said Hey we can write something Like new azure node app You will get the folder structure Then you say Hey create a node web role You will get a web role Hey create a node worker You will get the web role Now you can say NPM manager To install an express If you want Or whatever other packages That you want So here you see This For example When I ran this command Which was The windows azure sdk Comes with a local emulator Or the simulator of the cloud So the simulator of the cloud Looks something like this So we can open it And take a look at it And This Simulator Will try to just Simulate If you deploy to the real cloud How is it on your desktop Right So here We have gone ahead And deployed this Service here And you get some This Is the output That is being generated In fact if you see That If you keep on generating Some new For 10 seconds So This is coming from the azure tables Now how do you even Understand what is happening Or Where is the azure tables For example So There are various ways To look at azure tables The easiest is Through visual studio Otherwise you build Your own As there is The restenable So you build your viewer for it But you are just going And taking There is a table We created a table Called ports And on the ports We can go and take a look At the table In fact we can go And See that It has a lot of data Into this table How is this data being fed You can go And See this So there is something called get quotes If you open up the get quotes See what is there inside it It just has a server.js And it has Node.exe Which means that This is a worker role All it does Is this node.exe And you can set certain configurations On app.config For example I want to collect To this storage Etc So if you open up this Server.js And see what It looks like You see that Extremely Simple That's about it In fact there is an azure table So you have a handle To the table You can take a These are the table operations You can insert it Now this keeps inserting Rows into the table At a specified time interval Which is also specified there And Yeah And then there is the other thing Which is the web role Which we set So if you go to the show quotes Here The web role Will look at And You see the web role It's a little interesting To take a look at How this is organized You have The web.config And you also have The modules Where we can include The modules Which we want And if you see You have the is-node here Point to note Is this is-node Is Installed to the Real Windows Azure When you deploy it Because for example When you're creating a virtual machine You will need to Give the virtual machine Node.exe And is-node right Because it's not Good to have any Compact So you're packaging that Also and then uploading that So all of these I'll just close with Why can't this be part Of the VHD itself? The Windows Azure VMs Are Windows Server 2008 R2 With .NET 4.2 And IS 7.5 That configuration is there On the VM So when you want to have Node instance You're going to have Node.exe Also Why do you need to Shift your own Node.exe Not shift You go and upload So as of today The cloud is structured Such that These are the only confidence Anything Outside of that Third party Node.exe is not in the VM It's not already there In the VM I don't know I don't understand I thought maybe You guys are So It's only dotted It's actually Seamless to you At the end of the day You just have to Even creating something Call a start-up task For you to say While you're booting The VM Do this Silent installation And start-up Take care of the Versioning of Node Also The version you're testing Again gets You don't have to wait For Azure please And we'll close with that Online portal Windows.azure.com The main site is Windowsazure.com You could go to Bit.ly Node.js download That's pretty much All the Node.js downloads For Azure And The web platform Install the Microsoft