<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Shiju Varghese's Blog</title><link>http://weblogs.asp.net/shijuvarghese/default.aspx</link><description>Cloud Development with Windows Azure</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ShijuVBlog" /><feedburner:info uri="shijuvblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>ShijuVBlog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><title>Social meet up on Twitter for MEET Windows Azure on June the 7th</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/PVBxIAUjZBI/social-meet-up-on-twitter-for-meet-windows-azure-on-june-the-7th.aspx</link><pubDate>Mon, 28 May 2012 05:16:12 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8540360</guid><dc:creator>shiju</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8540360</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8540360</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/05/28/social-meet-up-on-twitter-for-meet-windows-azure-on-june-the-7th.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2"&gt;Get ready to &lt;a href="http://www.meetwindowsazure.com/" target="_blank"&gt;MEET Windows Azure&lt;/a&gt; live on June the 7th. The Microsoft Windows Azure team is conducting an online event “Meet Windows Azure” on June 7th 2012 starting at 1 PM PDT. The event will be presented by Scott Guthrie. If you want to watch event&amp;#160; live, you can register here: &lt;/font&gt;&lt;a href="http://register.meetwindowsazure.com/" target="_blank"&gt;&lt;font size="2"&gt;http://register.meetwindowsazure.com/&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://register.meetwindowsazure.com/" target="_blank"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="AzureBanner_300x250_3" border="0" alt="AzureBanner_300x250_3" src="http://weblogs.asp.net/blogs/shijuvarghese/AzureBanner_300x250_3_3731A805.png" width="454" height="296" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you are planning to attend the event and want to be social, there is a Social meet up on Twitter &lt;a href="http://lanyrd.com/2012/meetazure/" target="_blank"&gt;event&lt;/a&gt; organized by Windows Azure MVP &lt;a href="http://www.magnusmartensson.com/post/2012/05/16/Social-meet-up-on-Twitter-for-MEET-Windows-Azure-on-June-7th.aspx" target="_blank"&gt;Magnus Martensson&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;MEET Windows Azure Blog Relay:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Roger Jennings (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=https%3a%2f%2ftwitter.com%2f%23!%2frogerjenn"&gt;@rogerjenn&lt;/a&gt;): &lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2foakleafblog.blogspot.se%2f2012%2f05%2fsocial-meet-up-on-twitter-for-meet.html"&gt;Social meet up on Twitter for Meet Windows Azure on June 7th&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Anton Staykov (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=https%3a%2f%2ftwitter.com%2f%23!%2fastaykov"&gt;@astaykov&lt;/a&gt;): &lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2fblogs.staykov.net%2f2012%2f05%2fmeet-windows-azure-on-june-7th.html"&gt;MEET Windows Azure on June the 7th&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Patriek van Dorp (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=https%3a%2f%2ftwitter.com%2f%23!%2fpvandorp"&gt;@pvandorp&lt;/a&gt;): &lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2fcloudythoughts.siadis.com%2fwindows-azure%2fsocial-meet-up-for-meet-windows-azure-on-june-7th"&gt;Social Meet Up for ‘MEET Windows Azure’ on June 7th&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Marcel Meijer (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=https%3a%2f%2ftwitter.com%2f%23!%2fMarcelMeijer"&gt;@MarcelMeijer&lt;/a&gt;): &lt;a href="ttp://blogs.msmvps.com/marcelmeijer/blog/2012/05/16/meet-windows-azure-on-june-the-7th"&gt;MEET Windows Azure on June the 7th&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Nuno Godinho (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=https%3a%2f%2ftwitter.com%2f%23!%2fNunoGodinho"&gt;@NunoGodinho&lt;/a&gt;): &lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2fmsmvps.com%2fblogs%2fnunogodinho%2farchive%2f2012%2f05%2f16%2fsocial-meet-up-for-meet-windows-azure-on-june-7th.aspx"&gt;Social Meet Up for ‘MEET Windows Azure’ on June 7th&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Shaun Xu (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=https%3a%2f%2ftwitter.com%2f%23%2521%2fshaunxu"&gt;@shaunxu&lt;/a&gt;) &lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2fblogs.shaunxu.me%2farchive%2f2012%2f05%2f16%2fletrsquos-meet-windows-azure.aspx"&gt;Let's MEET Windows Azure&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Maarten Balliauw (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=https%3a%2f%2ftwitter.com%2f%23!%2fmaartenballiauw"&gt;@maartenballiauw&lt;/a&gt;): &lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2fblog.maartenballiauw.be%2fpost%2f2012%2f05%2f17%2fSocial-meet-up-on-Twitter-for-MEET-Windows-Azure-on-June-7th.aspx"&gt;Social meet up on Twitter for MEET Windows Azure on June 7th&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Brent Stineman (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=https%3a%2f%2ftwitter.com%2f%23!%2fbrentcodemonkey"&gt;@brentcodemonkey&lt;/a&gt;): &lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2fbrentdacodemonkey.wordpress.com%2f2012%2f05%2f17%2fmeet-windows-azure-june72012%2f"&gt;Meet Windows Azure (aka Learn Windows Azure v2)&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Herve Roggero (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2ftwitter.com%2fhroggero"&gt;@hroggero&lt;/a&gt;): &lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2fgeekswithblogs.net%2fhroggero%2farchive%2f2012%2f05%2f17%2fsocial-meet-up-on-twitter-for-meet-windows-azure-on.aspx"&gt;Social Meet up on Twitter for Meet Windows Azure on June 7th&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Paras Doshi (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2ftwitter.com%2f%23!%2fparas_doshi"&gt;@paras_doshi&lt;/a&gt;): &lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2fparasdoshi.com%2f2012%2f05%2f19%2fget-started-on-windows-azure-attend-meet-windows-azure-event-online%2f"&gt;Get started on Windows Azure: Attend “Meet Windows Azure” event Online&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Simran Jindal (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2ftwitter.com%2f%23!%2fSimranJindal"&gt;@SimranJindal&lt;/a&gt;): &lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2fsimranjindal.wordpress.com%2f2012%2f05%2f21%2fmeet-windows-azure-an-online-and-in-person-event-social-meetup-meetazure-beer-for-beer-lovers-on-june-7th-2012%2f"&gt;Meet Windows Azure – an online and in person event, social meetup #MeetAzure (+ Beer for Beer lovers) on June 7th 2012&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Magnus Mårtensson (&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=https%3a%2f%2ftwitter.com%2f%23!%2fnoopman"&gt;@noopman&lt;/a&gt;): &lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2fwww.magnusmartensson.com%2fpost%2f2012%2f05%2f16%2fSocial-meet-up-on-Twitter-for-MEET-Windows-Azure-on-June-7th.aspx"&gt;Social meet up on Twitter for MEET Windows Azure on June 7th&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Kris van der Mast (@&lt;a href="http://blog.krisvandermast.com/ct.ashx?id=4ceb37d5-e3a6-4028-8bb7-ecdfb0d196f7&amp;amp;url=http%3a%2f%2ftwitter.com%2f%23!%2fKvdM"&gt;KvdM&lt;/a&gt;):&lt;/li&gt;    &lt;li&gt;Shiju Varghese (&lt;a href="https://twitter.com/shijucv" target="_blank"&gt;@shijucv&lt;/a&gt;) &lt;a href="http://weblogs.asp.net/shijuvarghese/archive/2012/05/28/social-meet-up-on-twitter-for-meet-windows-azure-on-june-the-7th.aspx" target="_blank"&gt;Social meet up on Twitter for MEET Windows Azure on June the 7th&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font size="2"&gt;I hope to see you online for the social meet event on the 7th. My Twitter user name is &lt;/font&gt;&lt;a href="https://twitter.com/shijucv" target="_blank"&gt;&lt;font size="2"&gt;@shijucv&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Call to action:&lt;/strong&gt; Link to this blog post on your blog and I will update this post to link to you.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8540360" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/PVBxIAUjZBI" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure/default.aspx">Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/05/28/social-meet-up-on-twitter-for-meet-windows-azure-on-june-the-7th.aspx</feedburner:origLink></item><item><title>Developing and Deploying Node.js Express Web App on Windows Azure</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/lFT5ELqSyCA/developing-and-deploying-node-js-express-web-app-on-windows-azure.aspx</link><pubDate>Sat, 26 May 2012 17:54:47 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8536043</guid><dc:creator>shiju</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8536043</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8536043</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/05/26/developing-and-deploying-node-js-express-web-app-on-windows-azure.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2"&gt;In my last post &lt;/font&gt;&lt;a href="http://weblogs.asp.net/shijuvarghese/archive/2012/05/23/beginner-s-guide-to-node-js-on-windows-azure.aspx" target="_blank"&gt;&lt;font size="2"&gt;Beginner’s Guide to Node.js on Windows Azure&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;, I have introduced Node.js and Windows Azure Tools for Node.js. In this post, I will demonstrate how to develop and deploy a Node.js web app using Windows Azure PowerShell for Node.js. In this demo web app, I will be using Node module Express as the web app framework and Jade as the view engine for the HTML view templates. We are using&amp;#160; Windows Azure PowerShell for Node.js for developing and deploying the app on Windows Azure. If you want to deploy Node.js apps on Windows Azure using &lt;/font&gt;&lt;a href="http://c9.io/" target="_blank"&gt;&lt;font size="2"&gt;Cloud9 IDE&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;, check out my blog post from &lt;/font&gt;&lt;a href="http://weblogs.asp.net/shijuvarghese/archive/2012/03/08/building-and-deploying-node-js-apps-to-windows-azure-using-cloud9-ide.aspx" target="_blank"&gt;&lt;font size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;This blog post and demo app will demonstrate the following:&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2"&gt;How to develop and test Node.js apps on Windows Azure using&amp;#160; Windows Azure PowerShell for Node.js &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2"&gt;How to install Node modules using npm with Windows PowerShell cmdlets &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2"&gt;How to use Express module for developing web apps &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2"&gt;How to use Jade view engine with Express web app &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2"&gt;How to deploy Node.js web app on Windows Azure &lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font size="2"&gt;The Windows Azure PowerShell for Node.js is a command-line tool that&amp;#160; allows the Node developers to build and deploy Node.js apps in Windows Azure using Windows PowerShell cmdlets. Using Windows Azure PowerShell for Node.js, you can develop, test, deploy and manage Node based hosted service in Windows Azure. For more reference on Windows Azure PowerShell for Node.js, check out my blog post &lt;/font&gt;&lt;a href="http://weblogs.asp.net/shijuvarghese/archive/2012/03/20/windows-azure-powershell-for-node-js.aspx" target="_blank"&gt;&lt;font size="2"&gt;Windows Azure PowerShell for Node.js&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Create Hosted Service&lt;/strong&gt;&amp;#160;&lt;strong&gt;and Web Role using PowerShell for Node.js,&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;For getting the Windows Azure PowerShell for Node.js, click All Programs, Windows Azure SDK for Node.js and run&amp;#160; Windows Azure PowerShell for Node.js, as Administrator.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/powershell_open_1026FA2A.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="powershell_open" border="0" alt="powershell_open" src="http://weblogs.asp.net/blogs/shijuvarghese/powershell_open_thumb_307E8A1C.png" width="319" height="261" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The Windows PowerShell cmdlet will create a hosted service named ExpressNode &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/createservice_command_7B152C1C.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="createservice_command" border="0" alt="createservice_command" src="http://weblogs.asp.net/blogs/shijuvarghese/createservice_command_thumb_60689003.png" width="439" height="57" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The above new Azure service will create the files ServiceConfiguration.Cloud.cscfg, ServiceConfiguration.Local.cscfg ServiceDefinition.csdef and deploymentSettings.json in the ExpressNode folder &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/newservice_filescreated_48EDDBD2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="newservice_filescreated" border="0" alt="newservice_filescreated" src="http://weblogs.asp.net/blogs/shijuvarghese/newservice_filescreated_thumb_54A32304.png" width="475" height="218" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The following command will add a new Web Role with name ExpressWebApp&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/add_newrole_48718310.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="add_newrole" border="0" alt="add_newrole" src="http://weblogs.asp.net/blogs/shijuvarghese/add_newrole_thumb_1FF2A0FC.png" width="440" height="59" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;This will create the following files in the web role ExpressWebApp as shown in the below picture&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/webrole_files_046D9EF9.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="webrole_files" border="0" alt="webrole_files" src="http://weblogs.asp.net/blogs/shijuvarghese/webrole_files_thumb_2ABF5C77.png" width="458" height="200" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Install Express and Jade Modules&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The demo Node web app will be developed by using the &lt;a href="http://expressjs.com/" target="_blank"&gt;Express&lt;/a&gt; framework. Express is an MVC framework for Node, which can be use for developing web apps and REST based web services. Let’s install express module onto the web role project. We can install the Express module using the node package manager &lt;a href="http://npmjs.org/" target="_blank"&gt;npm&lt;/a&gt; which will be working with Windows Azure PowerShell for Node.js. To install the Express, navigate to the web role project folder and execute the command &lt;em&gt;npm install express&lt;/em&gt; as shown in the below picture:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/npm_express_26855EE5.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="npm_express" border="0" alt="npm_express" src="http://weblogs.asp.net/blogs/shijuvarghese/npm_express_thumb_0F0AAAB4.png" width="531" height="231" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The express framework provides a scaffolding tool which can use for generating the basic MVC app with default structure. Let’s execute the Express scaffolding tool to generate the app&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/scaffolding_26458958.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="scaffolding" border="0" alt="scaffolding" src="http://weblogs.asp.net/blogs/shijuvarghese/scaffolding_thumb_00033000.png" width="532" height="312" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The scaffolding tool generate the files as shown in the above picture. By default, Express is using &lt;/font&gt;&lt;a href="http://jade-lang.com/" target="_blank"&gt;&lt;font size="2"&gt;Jade&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; view engine and will create few Jade files with extension .jade. We need to install the node modules having dependency with application generated by Express scaffolding tool. To install the all dependent node packages, just execute the command&lt;em&gt; npm install.&lt;/em&gt;This command will install the all dependent node modules. In our web app, it will install the dependent module Jade. All dependencies will be identified from the file package.json.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/npm_jade_dependency_08272FCA.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="npm_jade_dependency" border="0" alt="npm_jade_dependency" src="http://weblogs.asp.net/blogs/shijuvarghese/npm_jade_dependency_thumb_775F851B.png" width="456" height="370" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Let’s modify the generated application by Express scaffolding tool. I have just renamed the generated&amp;#160; app.js with server.js and added few code for our demo purpose. This below picture shown the folder structure of the modified app.&amp;#160; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/webrole_folder_3423E121.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="webrole_folder" border="0" alt="webrole_folder" src="http://weblogs.asp.net/blogs/shijuvarghese/webrole_folder_thumb_71D0C8DD.png" width="324" height="428" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Node.js Web App with Express and Jade&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The demo web app is a very simple app in which the home page will show the few blog list in a html table and the uri ‘/api’ expose a API method which returns all blog data as JSON format. The screen shots of the completed application is shown below&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_5CEEAA90.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_21F751FA.png" width="619" height="409" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_5EBBADFF.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_2600DE25.png" width="619" height="365" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Let’s create the HTTP server with Express and configure the basic configurations for the Express web app&lt;/font&gt;&lt;/p&gt;  &lt;div class="csharpcode"&gt;&amp;#160;&lt;/div&gt;  &lt;div class="csharpcode"&gt;&lt;font face="Arial"&gt;     &lt;div class="csharpcode"&gt;       &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; express = require(&lt;span class="str"&gt;'express'&lt;/span&gt;);&lt;/pre&gt;

      &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; app = module.exports = express.createServer();&lt;/pre&gt;

      &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; port = process.env.port || 1337;&lt;/pre&gt;

      &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

      &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="rem"&gt;// Configuration&lt;/span&gt;&lt;/pre&gt;

      &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;app.configure(&lt;span class="kwrd"&gt;function&lt;/span&gt;(){&lt;/pre&gt;

      &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;  app.set(&lt;span class="str"&gt;'views'&lt;/span&gt;, __dirname + &lt;span class="str"&gt;'/views'&lt;/span&gt;);&lt;/pre&gt;

      &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;  app.set(&lt;span class="str"&gt;'view engine'&lt;/span&gt;, &lt;span class="str"&gt;'jade'&lt;/span&gt;);  &lt;/pre&gt;

      &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;  app.use(express.&lt;span class="kwrd"&gt;static&lt;/span&gt;(__dirname + &lt;span class="str"&gt;'/public'&lt;/span&gt;));&lt;/pre&gt;

      &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;})&lt;/pre&gt;
    &lt;/div&gt;
    &lt;style type="text/css"&gt;





.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/font&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;





.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;We can import the Node modules using require(‘module_name’). Here we have imported the Express module and created an HTTP server using its createServer() method. In the configurations we have specified the folder name of the View files and set Jade as the View Engine.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;View Model Data for the Web App&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Let’s create some dummy data for passing to our view model object from the Express routes methods.&lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; Blog(author,url,technology) {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;  &lt;span class="kwrd"&gt;this&lt;/span&gt;.author = author;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;  &lt;span class="kwrd"&gt;this&lt;/span&gt;.url=url;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;  &lt;span class="kwrd"&gt;this&lt;/span&gt;.technology=technology;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;}&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="rem"&gt;// Blogs&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; blogs = [&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    &lt;span class="kwrd"&gt;new&lt;/span&gt; Blog(&lt;span class="str"&gt;'Shiju Varghese'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;      &lt;span class="str"&gt;'http://weblogs.asp.net/shijuvarghese/'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;      &lt;span class="str"&gt;'Windows Azure'&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;  , &lt;span class="kwrd"&gt;new&lt;/span&gt; Blog(&lt;span class="str"&gt;'Glenn Block'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    &lt;span class="str"&gt;'http://codebetter.com/glennblock/'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    &lt;span class="str"&gt;'Node on Azure'&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;  , &lt;span class="kwrd"&gt;new&lt;/span&gt; Blog(&lt;span class="str"&gt;'Steve Marx'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    &lt;span class="str"&gt;'http://blog.smarx.com/'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    &lt;span class="str"&gt;'Windows Azure'&lt;/span&gt;) &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;  , &lt;span class="kwrd"&gt;new&lt;/span&gt; Blog(&lt;span class="str"&gt;'Scott Guthrie'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    &lt;span class="str"&gt;'http://weblogs.asp.net/scottgu/'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    &lt;span class="str"&gt;'ASP.NET &amp;amp; Azure'&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;  , &lt;span class="kwrd"&gt;new&lt;/span&gt; Blog(&lt;span class="str"&gt;'Rinat Abdullin'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;    &lt;span class="str"&gt;'http://abdullin.com/'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;    &lt;span class="str"&gt;'CQRS'&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;];&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Web App Routes&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Our web app has two routes. The request for ‘/’ will pass the blog data to view template which will render the blog data in html table. The request ‘/api’ is exposing as API method and will return the blog data as JSON string.&lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;app.get(&lt;span class="str"&gt;'/'&lt;/span&gt;, &lt;span class="kwrd"&gt;function&lt;/span&gt;(req, res){&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;res.render(&lt;span class="str"&gt;'index'&lt;/span&gt;, {title:&lt;span class="str"&gt;'home'&lt;/span&gt;,blogs: blogs });&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;});&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;app.get(&lt;span class="str"&gt;'/api'&lt;/span&gt;, &lt;span class="kwrd"&gt;function&lt;/span&gt;(req, res){&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;  res.json(blogs);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;});&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;The HTTP Get request for ‘/’ will render the view file index.jade where we are passing view model data for title and blogs. Since we have specified the view engine as Jade, we don’t have to specify the .jade extension when specifying the view name. The application will look the view index.jade on the Views folder and will take layout.jade as the layout page if that jade files is exists.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Let’s add the Jade template syntax for the index.jade for displaying the blogs data in html table&lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;html&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;head&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    title Index&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;body&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    h1 Favourite Blogs&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    form    &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        table(border=&amp;quot;1&amp;quot;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            tr&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;                th Author &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;                th Url&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;                th Technology               &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;                each item in blogs&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                    tr&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;                        td #{item.author}  &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;                        td &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                            a(href ='#{item.url}') #{item.url}                       &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;                        td #{item.technology} &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;                                                 &lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;font size="2"&gt;&lt;/font&gt;

&lt;p&gt;&lt;font size="2"&gt;Let’s add a layout.jade which can use as layout page for the our web app&lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;html&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;  head&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    title= title&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    link(rel='stylesheet',&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;     href='/stylesheets/style.css')&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;  body!= body&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Running the Web App in Windows Azure&lt;/strong&gt; &lt;strong&gt;Emulator&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The Windows PowerShell cmdlet &lt;em&gt;Start-AzureEmulator –lauch&lt;/em&gt; will create the local package and you can run the app from the Windows Azure development emulator&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_034C79DD.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_73C9680D.png" width="496" height="127" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Download and Import Windows Azure&lt;/strong&gt; &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;We need to import the publish settings files in order to upload publish our apps on Windows Azure. Let’s download the Windows Azure publish settings file from Windows Azure Management portal. The PowerShell cmdlet &lt;em&gt;Get-AzurePublishSettings&lt;/em&gt; will redirect to publish settings download page in the Windows Azure Management portal. Let’s download the publish settings file.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/get_settings_0BDCAC9C.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="get_settings" border="0" alt="get_settings" src="http://weblogs.asp.net/blogs/shijuvarghese/get_settings_thumb_3FA4A2ED.png" width="493" height="26" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;To import the publish settings file to our web role app, execute the PowerShell cmdlet &lt;em&gt;Import-AzurePublishSettings&lt;/em&gt; with the location of the publish settings file we have downloaded in previous step. Please note that this is one time activity for your web role app. In later deployments, you can directory publish the app without import the publish settings file.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/import_setting_553EDB8A.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="import_setting" border="0" alt="import_setting" src="http://weblogs.asp.net/blogs/shijuvarghese/import_setting_thumb_45BBC9BB.png" width="559" height="93" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Publishing Node Web App on Windows Azure&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Let’s publish our Node web app on Windows Azure by using Windows PowerShell cmdlet &lt;em&gt;Publish-AzureService&lt;/em&gt; with name as ExpressNodeOnAzure and location as East Asia.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/azure_publish_5098AB03.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="azure_publish" border="0" alt="azure_publish" src="http://weblogs.asp.net/blogs/shijuvarghese/azure_publish_thumb_26D53010.png" width="624" height="338" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The following screen shot shows the Node web app running from the Windows Azure. &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/azure_web_ui_5209A14A.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="azure_web_ui" border="0" alt="azure_web_ui" src="http://weblogs.asp.net/blogs/shijuvarghese/azure_web_ui_thumb_75761FE2.png" width="561" height="400" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Source Code&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The source code of the Node.js app can download from GitHub at &lt;/font&gt;&lt;a href="https://github.com/shijuvar/NodeOnAzure"&gt;&lt;font size="2"&gt;https://github.com/shijuvar/NodeOnAzure&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. I have been using this source code repository for putting Node.js samples for Windows Azure and will add more samples on later time.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Summary&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Windows Azure is great and easy platform for building Node.js apps. Windows Azure is providing very rich support for building and deploying Node.js web apps on Windows Azure.The Windows Azure PowerShell for Node.js allows the Node developers to build, test and deploy Node.js apps on Windows Azure using Windows PowerShell cmdlets. Using Windows Azure PowerShell for Node.js, you can develop, test, deploy and manage Node based hosted service in Windows Azure &lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8536043" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/lFT5ELqSyCA" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure/default.aspx">Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Node.js/default.aspx">Node.js</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Web+Services/default.aspx">Web Services</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/05/26/developing-and-deploying-node-js-express-web-app-on-windows-azure.aspx</feedburner:origLink></item><item><title>Beginner’s Guide to Node.js on Windows Azure</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/QBF31-lnXOI/beginner-s-guide-to-node-js-on-windows-azure.aspx</link><pubDate>Wed, 23 May 2012 17:56:32 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8525111</guid><dc:creator>shiju</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8525111</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8525111</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/05/23/beginner-s-guide-to-node-js-on-windows-azure.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2"&gt;In this post, I will provide an introduction to &lt;/font&gt;&lt;font size="2"&gt;Node.js&lt;/font&gt;&lt;font size="2"&gt; and Windows Azure tools for Node.js and will also provide few resources to start and develop Node.js apps on Windows Azure. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/nodeazure_74797445.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="nodeazure" border="0" alt="nodeazure" src="http://weblogs.asp.net/blogs/shijuvarghese/nodeazure_thumb_2DDC38A3.png" width="363" height="302" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Introduction to Node.js&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The &lt;/font&gt;&lt;a href="http://nodejs.org/" target="_blank"&gt;&lt;font size="2"&gt;Node.js&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; website is given the following introduction on Node.js&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;“&lt;em&gt;Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices&lt;/em&gt;.”&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Node.js is created by Ryan Dahl in 2009 and supported by his employer &lt;/font&gt;&lt;a href="http://www.joyent.com/" target="_blank"&gt;&lt;font size="2"&gt;Joyent&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. Node.js is an open-source server-side JavaScript platform for&amp;#160; building high performance scalable network programs. Node.js is built on the top of Google's V8 JavaScript engine and the framework is also using other two open source projects&amp;#160; libev and libeio. Node.js uses a non blocking and&amp;#160; event-driven I/O model which provides the ability to handle thousands of parallel operations with greater performance. Node.js is popular for its performance and the Node.js apps are executed on the V8 runtime engine. Node.js lets the developers to write JavaScript programs on the server-side and its provides a JavaScript API to access the network and file systems. Node.js is providing the highly efficient TCP/IP networking features with the support of powerful asynchronous programming model which lets the developers to build highly scalable real-time apps. Ryan Dahl is mainly created the Node.js framework for building highly scalable real-time apps that communicating with larger audience in the web. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;Node is not a solution for every problems, but it is a great platform for some specific problems. &lt;font size="2"&gt;Since Node is capable for handling thousands concurrent requests, it is a great platform for building highly scalable systems. Node is good platform form building JSON based HTTP APIs, next generation real-time and collaborative web apps, Single page apps, Streaming data and many type of network programs. Today many organizations are adopting Node.js for their server-side stack for the Mobile apps. Big companies such as &lt;a href="http://venturebeat.com/2012/05/02/linkedin-ipad-app-engineering/#s:1-linkedin-ipad" target="_blank"&gt;Linkedin&lt;/a&gt;, &lt;a href="http://venturebeat.com/2012/01/24/why-walmart-is-using-node-js/" target="_blank"&gt;Walmart&lt;/a&gt;, &lt;a href="http://venturebeat.com/2012/04/02/yahoo-node-open-source-mojito/" target="_blank"&gt;Yahoo&lt;/a&gt;, &lt;a href="http://venturebeat.com/2012/01/24/node-at-google-mozilla-yahoo/" target="_blank"&gt;Google and Mozilla&lt;/a&gt; are using Node.js for their apps.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Installing Node.Js on Windows&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;You can download the Node.js installer for Windows from &lt;/font&gt;&lt;a href="http://nodejs.org/dist/v0.6.18/node-v0.6.18.msi" target="_blank"&gt;&lt;font size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. After installing the Node.js, you can run Node programs from the Windows command-line. The &lt;/font&gt;&lt;a href="https://github.com/tjanczuk/iisnode" target="_blank"&gt;&lt;font size="2"&gt;iisnode&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; project which allows to hosting node.js apps on&amp;#160; IIS web server. The documentation of iisnode page is available from &lt;/font&gt;&lt;a href="https://github.com/tjanczuk/iisnode/wiki" target="_blank"&gt;&lt;font size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;NPM&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://npmjs.org/" target="_blank"&gt;&lt;font size="2"&gt;npm&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; is a package manager for node.js programs.You can use npm to install node modules created by community. npm manages dependencies of node modules. npm is very similar to &lt;/font&gt;&lt;a href="https://nuget.org/" target="_blank"&gt;&lt;font size="2"&gt;NuGet&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; in the .Net. To install a Node module, run the npm command as shown in the below&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;npm install &amp;lt;module name&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The following command will install a node module express &lt;/font&gt;&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;font face="Arial"&gt;npm install express&lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;div class="csharpcode"&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/div&gt;

&lt;div class="csharpcode"&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;








.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;









.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Creating a HTTP Server using Node.js&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Let’s create a simple HTTP server using Node.js. &lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; http = require(&lt;span class="str"&gt;'http'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;http.createServer(&lt;span class="kwrd"&gt;function&lt;/span&gt; (req, res) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;res.writeHead(200, {&lt;span class="str"&gt;'Content-Type'&lt;/span&gt;: &lt;span class="str"&gt;'text/plain'&lt;/span&gt;});&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;res.end(&lt;span class="str"&gt;'hello world\n'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;}).listen(8000, &lt;span class="str"&gt;&amp;quot;127.0.0.1&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;







.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;The above program will create a HTTP server which will listen for an event in port 8000 at &lt;/font&gt;&lt;a title="http://127.0.0.1" href="http://127.0.0.1"&gt;&lt;font size="2"&gt;http://127.0.0.1&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. Let me save this file as server.js. To execute this program, open up Windows command-line and enter the following command:&lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;font face="Arial"&gt;node server.js&lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;style type="text/css"&gt;







.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;font size="2"&gt;Let's navigate to &lt;/font&gt;&lt;a href="http://127.0.0.1:8000/"&gt;&lt;font size="2"&gt;http://127.0.0.1:8000/&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; in a web browser that show a web page which shows the text &amp;quot;hello world&amp;quot;.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Node.js on Windows Azure&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Windows Azure is a powerful cloud platform which provides the first class support for Node.js&amp;#160; which lets the Node developers to build and deploy Node.js apps onto Windows Azure. &lt;/font&gt;&lt;a href="https://github.com/tjanczuk/iisnode" target="_blank"&gt;&lt;font size="2"&gt;IISNode&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; is the enable component of Windows Azure for Node.js apps.The blog post &lt;/font&gt;&lt;a href="http://blogs.msdn.com/b/hanuk/archive/2012/05/05/top-benefits-of-running-node-js-on-windows-azure.aspx" target="_blank"&gt;&lt;font size="2"&gt;Top Benefits of Running Node.js on Windows Azure&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; provides the major benefits for deploying Node.js apps in Windows Azure. For more details on Windows Azure support for Node.js, check out the &lt;/font&gt;&lt;a href="https://www.windowsazure.com/en-us/develop/nodejs/" target="_blank"&gt;&lt;font size="2"&gt;Windows Azure Node.js Developer Center&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Windows Azure SDK for Node.js&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The Windows Azure SDK for Node.js provides the full fledged support to develop and deploy lopeNode.js apps onto Windows Azure. With Windows Azure SDK for Node.js, you can deploy Node.js apps onto Windows Azure as a Web Role which will be available for scalability provided by Windows Azure. You can download the Windows Azure SDK for Node.js from &lt;/font&gt;&lt;a href="http://www.microsoft.com/click/services/Redirect2.ashx?CR_EAC=300036459" target="_blank"&gt;&lt;font size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. The current version of the SDK is &lt;/font&gt;&lt;a href="http://weblogs.asp.net/shijuvarghese/archive/2012/05/14/windows-azure-sdk-for-node-js-0-5-4-released.aspx" target="_blank"&gt;&lt;font size="2"&gt;0.5.4&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Windows Azure PowerShell for Node.js&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The Windows Azure PowerShell for Node.js is a command-line tool that&amp;#160; allows the Node developers to build and deploy Node.js apps in Windows Azure using Windows PowerShell cmdlets. Using Windows Azure PowerShell for Node.js, you can develop, test, deploy and manage Node based hosted service in Windows Azure. For more details on Windows Azure PowerShell for Node.js, check out my blog post &lt;/font&gt;&lt;a href="http://weblogs.asp.net/shijuvarghese/archive/2012/03/20/windows-azure-powershell-for-node-js.aspx" target="_blank"&gt;&lt;font size="2"&gt;Windows Azure PowerShell for Node.js&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. The following resource will provide all details about the Windows Azure PowerShell for Node.js &lt;/font&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/hh689725.aspx" target="_blank"&gt;&lt;font size="2"&gt;Windows Azure PowerShell for Node.js Cmdlet Reference&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="https://www.windowsazure.com/en-us/develop/nodejs/how-to-guides/powershell-cmdlets/" target="_blank"&gt;&lt;font size="2"&gt;How to Use Windows Azure PowerShell for Node.js&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Using Cloud9 IDE for Building and Deploying apps in Windows Azure&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Cloud9 IDE is a cross-platform, browser-based development environment for JavaScript and Node.js apps which can be used for developing and deploying Node.js apps in Windows Azure. My blog post &lt;/font&gt;&lt;a href="http://weblogs.asp.net/shijuvarghese/archive/2012/03/08/building-and-deploying-node-js-apps-to-windows-azure-using-cloud9-ide.aspx" target="_blank"&gt;&lt;font size="2"&gt;Building and Deploying Node.js Apps to Windows Azure using Cloud9 IDE&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Here’s a few more links for Node.js and Windows Azure&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="https://www.windowsazure.com/en-us/develop/nodejs/" target="_blank"&gt;&lt;font size="2"&gt;Windows Azure Node.js Developer Center&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/li&gt;

  &lt;li&gt;&lt;font size="2"&gt;Glen Block’s (Senior Program Manager - Windows Azure SDK for Node.js) &lt;/font&gt;&lt;a href="http://codebetter.com/glennblock/" target="_blank"&gt;&lt;font size="2"&gt;Blog&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://anodejs.org/" target="_blank"&gt;&lt;font size="2"&gt;Anode =&amp;gt; Windows Azure + Node.js&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://channel9.msdn.com/Events/windowsazure/learn/Interview-with-Glenn-Block-Talking-About-Node-js-on-Windows-Azure" target="_blank"&gt;&lt;font size="2"&gt;Interview with Glenn Block Talking About Node.js on Windows Azure&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&amp;#160; &lt;/font&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/brunoterkaly/archive/2012/03/17/node-js-the-most-popular-modules-and-how-they-work-part-1-a-bakers-dozen.aspx" target="_blank"&gt;&lt;font size="2"&gt;Node.js–How to use Node Package Manager (npm) and Underscore&lt;/font&gt;&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;My GitHub repository on &lt;a href="https://github.com/shijuvar/NodeOnAzure" target="_blank"&gt;Node.js on Windows Azure&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://weblogs.asp.net/shijuvarghese/archive/2012/05/26/developing-and-deploying-node-js-express-web-app-on-windows-azure.aspx" target="_blank"&gt;Developing and Deploying Node.js Express Web App on Windows Azure&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://www.nodebeginner.org/" target="_blank"&gt;&lt;font size="2"&gt;The Node Beginner Book&lt;/font&gt;&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://coding.smashingmagazine.com/2011/09/16/useful-node-js-tools-tutorials-and-resources/" target="_blank"&gt;&lt;font size="2"&gt;Useful Node.js Tools, Tutorials And Resources&lt;/font&gt;&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8525111" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/QBF31-lnXOI" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure/default.aspx">Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Node.js/default.aspx">Node.js</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/05/23/beginner-s-guide-to-node-js-on-windows-azure.aspx</feedburner:origLink></item><item><title>Building a Simple HTTP API using Node.js with MongoDB and Mongoose</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/ER3OxQ6ClcA/building-a-simple-rest-api-using-node-js-with-mongodb-and-mongoose.aspx</link><pubDate>Sat, 19 May 2012 12:27:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8503383</guid><dc:creator>shiju</dc:creator><slash:comments>4</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8503383</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8503383</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/05/19/building-a-simple-rest-api-using-node-js-with-mongodb-and-mongoose.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2"&gt;In this post, I will demonstrate how to build a simple HTTP API using Node.js with NoSQL database MongoDB. This demo app will be using MongoDB object modeling tool Mongoose to connecting with MongoDB from the Node app. This demo app is a very basic level JSON based HTTP API which is not following any better practices and mainly created this sample demo for demonstrating Node.js and MongoDB using with Mongoose Node package.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;b&gt;Node.js and MongoDB for building REST JSON API&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Node.js is a very powerful platform for building highly scalable REST based JSON APIs. A Node.js app with a NoSQL database MongoDB can provide great performance and better scalability. The latest speed up results for the MongoDB Native Driver for Node.js available from &lt;a href="http://www.eweek.com/c/a/Application-Development/MongoDB-Native-Driver-for-Nodejs-Speeds-Up-Results-176150/" mce_href="http://www.eweek.com/c/a/Application-Development/MongoDB-Native-Driver-for-Nodejs-Speeds-Up-Results-176150/" target="_blank"&gt;here&lt;/a&gt;. I am in the process of building highly scalable REST API on the Windows Azure platform using Node.js and MongoDB and will be put the samples on my &lt;a href="https://github.com/shijuvar" mce_href="https://github.com/shijuvar" target="_blank"&gt;Github&lt;/a&gt; repositories in future.&amp;nbsp; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;b&gt;Node packages&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The following Node packages to be installed in the app in order to working the demo app.&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2"&gt;&lt;a href="http://expressjs.com/" mce_href="http://expressjs.com/" target="_blank"&gt;express&lt;/a&gt;&amp;nbsp;&lt;/font&gt; &lt;/li&gt;    &lt;li&gt;&lt;font size="2"&gt;&lt;a href="http://mongoosejs.com/" mce_href="http://mongoosejs.com/" target="_blank"&gt;mongoose&lt;/a&gt;&lt;/font&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font size="2"&gt;Express is a web development module for Node.js. Mongoose is a Node.js ORM module for working with MongoDB database.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;b&gt;Creating Server and Connecting to MongoDB&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The following code block will create the server using express module and connecting to the MongoDB database using the Mongoose.&lt;/font&gt;&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt; &lt;span class="rem"&gt;//Creating server&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; express = require(&lt;span class="str"&gt;'express'&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;      , app = express.createServer()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;      , mongoose = require(&lt;span class="str"&gt;'mongoose'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;      &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="rem"&gt;//Connecting to MongoDB&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt; mongoose.connect(&lt;span class="str"&gt;'mongodb://localhost/ProductDB'&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;b&gt;Creating the Model using Mongoose&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Let’s define the Model objects using the Mongoose&lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="rem"&gt;//Models using Mongoose&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt; var Schema = mongoose.Schema&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt; , ObjectId = Schema.ObjectID;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt; var Product = &lt;span class="kwrd"&gt;new&lt;/span&gt; Schema({&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;   name : { type: String, required: &lt;span class="kwrd"&gt;true&lt;/span&gt;, trim: &lt;span class="kwrd"&gt;true&lt;/span&gt; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;  ,unitPrice  : { type: Number, required: &lt;span class="kwrd"&gt;true&lt;/span&gt; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;  ,itemsInStock  : { type: Number, required: &lt;span class="kwrd"&gt;true&lt;/span&gt; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;  });    &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;var Category = &lt;span class="kwrd"&gt;new&lt;/span&gt; Schema({&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt; name   : { type: String, required: &lt;span class="kwrd"&gt;true&lt;/span&gt;, trim: &lt;span class="kwrd"&gt;true&lt;/span&gt; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt; ,description    :  { type: String, required: &lt;span class="kwrd"&gt;true&lt;/span&gt;, trim: &lt;span class="kwrd"&gt;true&lt;/span&gt; }  &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt; ,products         : [Product]       &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt; });    &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;var ProductCatalog = mongoose.model(&lt;span class="str"&gt;'Category'&lt;/span&gt;, Category);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;In the above code block, we have created the schema for Product and Category and Prodcut schema used as embedded document in the Category schema. We can define the Model using the mongoose.Model. &lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; ProductCatalog = mongoose.model(&lt;span class="str"&gt;'Category'&lt;/span&gt;, Category);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;b&gt;Exposing the API methods&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The following function returns the all product catalog information as a JSON string. &lt;/font&gt;The request for ‘/’ will return the all product catalog&lt;font size="2"&gt; data.&lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt; &lt;span class="rem"&gt;//Get all product catalog &lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;  app.get(&lt;span class="str"&gt;'/'&lt;/span&gt;, &lt;span class="kwrd"&gt;function&lt;/span&gt;(req,res){    &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt; ProductCatalog.find({}, &lt;span class="kwrd"&gt;function&lt;/span&gt;(error, data){&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt;(error){&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;             res.json(error);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt;(data == &lt;span class="kwrd"&gt;null&lt;/span&gt;){&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;             res.json(&lt;span class="str"&gt;'Empty data'&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;              res.json(data);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;            &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        });&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    });&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;font size="2"&gt;The following function returns the category information for a given category name. The request ‘/name’ will be executed the following API method.&lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="rem"&gt;//Get a specified category&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;app.get(&lt;span class="str"&gt;'/:name'&lt;/span&gt;, &lt;span class="kwrd"&gt;function&lt;/span&gt;(req,res){    &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt; ProductCatalog.findOne({ name: req.&lt;span class="kwrd"&gt;params&lt;/span&gt;.name },&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    &lt;span class="kwrd"&gt;function&lt;/span&gt;(error, category){&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt;(error){&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;      res.json(error);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;     }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;     &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt;(category == &lt;span class="kwrd"&gt;null&lt;/span&gt;){&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;           res.json(&lt;span class="str"&gt;'Category not found!'&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;     }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;  &lt;span class="kwrd"&gt;else&lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;     res.json(category);    &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;      }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;   });            &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;  });&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    &lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;font size="2"&gt;&lt;/font&gt;

&lt;p&gt;&lt;font size="2"&gt;The request for '/addcategory/name/description' will be executed the following method and will add a new category to the MongoDB database.The method will return the added data as JSON. &lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;app.get(&lt;span class="str"&gt;'/addcategory/:name/:description'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt; &lt;span class="kwrd"&gt;function&lt;/span&gt;(req, res){&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt; &lt;span class="kwrd"&gt;var&lt;/span&gt; categoryData = {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt; name: req.&lt;span class="kwrd"&gt;params&lt;/span&gt;.name&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;  , description: req.&lt;span class="kwrd"&gt;params&lt;/span&gt;.description         &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;};&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; category = &lt;span class="kwrd"&gt;new&lt;/span&gt; ProductCatalog(categoryData);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt; &lt;span class="rem"&gt;//Save data&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt; category.save( &lt;span class="kwrd"&gt;function&lt;/span&gt;(error, data){&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt;(error){&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt; res.json(error);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;&lt;span class="kwrd"&gt;else&lt;/span&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;res.json(data);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;   }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt; });&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;});&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;b&gt;Source Code&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;I have created a &lt;a href="https://github.com/shijuvar/RESTNode" mce_href="https://github.com/shijuvar/RESTNode" target="_blank"&gt;repository&lt;/a&gt; in Github for putting REST API samples. This is the first and basic level sample which can be download from &lt;a href="https://github.com/shijuvar/RESTNode" mce_href="https://github.com/shijuvar/RESTNode" target="_blank"&gt;here&lt;/a&gt;. This is a very introductory level post mainly used for demonstrating Node.js and MongoDB with Mongoose. I will update the source code repository with more samples.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8503383" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/ER3OxQ6ClcA" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure/default.aspx">Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/NoSQL/default.aspx">NoSQL</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Node.js/default.aspx">Node.js</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Web+Services/default.aspx">Web Services</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/05/19/building-a-simple-rest-api-using-node-js-with-mongodb-and-mongoose.aspx</feedburner:origLink></item><item><title>Windows Azure SDK for Node.js 0.5.4 Released</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/iKRU6DfEG_U/windows-azure-sdk-for-node-js-0-5-4-released.aspx</link><pubDate>Mon, 14 May 2012 06:14:58 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8475699</guid><dc:creator>shiju</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8475699</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8475699</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/05/14/windows-azure-sdk-for-node-js-0-5-4-released.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2"&gt;The Microsoft Windows Azure team has released the Windows Azure SDK for Node.js 0.5.4 which&amp;#160; will be using the Node.js 0.6.17 and iisnode 0.1.19. The Node.js 0.6.17 contains a security fix against the &lt;/font&gt;&lt;a href="http://blog.nodejs.org/2012/05/07/http-server-security-vulnerability-please-upgrade-to-0-6-17/" target="_blank"&gt;&lt;font size="2"&gt;HTTP Server Security Vulnerability&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; detected by recently. It would be recommended to upgrade to the new version of Azure SDK for Node.js if you have already deployed any Node.js app to Windows Azure which will provide better security. The iisnode 0.1.19 provides &lt;/font&gt;&lt;a href="http://tomasz.janczuk.org/2012/05/yaml-configuration-support-in-iisnode.html" target="_blank"&gt;&lt;font size="2"&gt;iisnode.yml&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; file instead of XML based configurations which can be use for setting up all iisnode settings. You can download the Windows Azure SDK for Node.js 0.5.4 from &lt;/font&gt;&lt;a href="http://www.microsoft.com/web/gallery/install.aspx?appid=azurenodepowershell" target="_blank"&gt;&lt;font size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8475699" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/iKRU6DfEG_U" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure/default.aspx">Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Node.js/default.aspx">Node.js</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/05/14/windows-azure-sdk-for-node-js-0-5-4-released.aspx</feedburner:origLink></item><item><title>Windows Azure Supports Voice and SMS Capabilities</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/ELfoSl1AS3U/windows-azure-supports-voice-and-sms-capabilities.aspx</link><pubDate>Fri, 04 May 2012 07:06:18 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8437531</guid><dc:creator>shiju</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8437531</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8437531</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/05/04/windows-azure-supports-voice-and-sms-capabilities.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2"&gt;Windows Azure is now supports Telephony and SMS capabilities to the apps hosted in Windows Azure by using the Twilio API. &lt;/font&gt;&lt;a href="http://www.twilio.com/" target="_blank"&gt;&lt;font size="2"&gt;Twilio&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; is a third-party service that provides a cloud-based telephony service which allows to add scalable, reliable voice and text messaging capabilities into you apps. Using Twilio's &lt;/font&gt;&lt;a href="http://www.twilio.com/docs/libraries" target="_blank"&gt;&lt;font size="2"&gt;native libraries for Java, PHP and .NET&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;, developers can build telephony enabled web apps hosted on Windows Azure in which we can make and receive phone calls and SMS messages from&amp;#160; phones and web apps. Twillio is providing 1,000 free text messages or 1,000 voice minutes for Windows Azure developers and you can get the free offerings for Windows Azure from &lt;/font&gt;&lt;a href="http://www.twilio.com/try-twilio?promo=azure" target="_blank"&gt;&lt;font size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; .&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Check out the following links for getting more details on Twillio API and working it with Windows Azure&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.twilio.com/docs/libraries" target="_blank"&gt;&lt;font size="2"&gt;Twillio API&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="https://www.windowsazure.com/en-us/develop/net/how-to-guides/twilio-voice-and-sms-service/" target="_blank"&gt;&lt;font size="2"&gt;How to Use Twilio for Voice and SMS Capabilities from Windows Azure&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.twilio.com/azure" target="_blank"&gt;&lt;font size="2"&gt;Twillio offer for Windows Azure&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://nuget.org/packages/Twilio" target="_blank"&gt;&lt;font size="2"&gt;Twilio NuGet Package&lt;/font&gt;&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8437531" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/ELfoSl1AS3U" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure/default.aspx">Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/05/04/windows-azure-supports-voice-and-sms-capabilities.aspx</feedburner:origLink></item><item><title>Dependency Injection in ASP.NET Web API using Autofac</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/bV5i9fgAF7Q/dependency-injection-in-asp-net-web-api-using-autofac.aspx</link><pubDate>Sun, 01 Apr 2012 09:29:11 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8372579</guid><dc:creator>shiju</dc:creator><slash:comments>7</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8372579</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8372579</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/04/01/dependency-injection-in-asp-net-web-api-using-autofac.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2"&gt;In this post, I will demonstrate how to use Dependency Injection in ASP.NET Web API using &lt;/font&gt;&lt;a href="http://code.google.com/p/autofac/" target="_blank"&gt;&lt;font size="2"&gt;Autofac&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; in an ASP.NET MVC 4 app. The new ASP.NET Web API is a great framework for building HTTP services. The Autofac IoC container provides the better integration with ASP.NET Web API for applying dependency injection. The NuGet package &lt;/font&gt;&lt;a href="https://nuget.org/packages/Autofac.WebApi/" target="_blank"&gt;&lt;font size="2"&gt;Autofac.WebApi&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; provides the&amp;#160; Dependency Injection support for ASP.NET Web API services.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Using Autofac in ASP.NET Web API&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The following command in the Package Manager console will install Autofac.WebApi package into your ASP.NET Web API application.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;PM &amp;gt; Install-Package Autofac.WebApi&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_0C06BBD4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_06882563.png" width="492" height="84" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The following code block imports the necessary namespaces for using Autofact.WebApi &lt;/font&gt;&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Autofac;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Autofac.Integration.WebApi;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;









.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;The following&lt;/font&gt; code in the Bootstrapper class configures the Autofac. &lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Bootstrapper&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Run()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt; {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;     SetAutofacWebAPI();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt; }       &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt; &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SetAutofacWebAPI()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt; {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    var configuration = GlobalConfiguration.Configuration;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    var builder = &lt;span class="kwrd"&gt;new&lt;/span&gt; ContainerBuilder();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    &lt;span class="rem"&gt;// Configure the container &lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    builder.ConfigureWebApi(configuration);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    &lt;span class="rem"&gt;// Register API controllers using assembly scanning.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    builder.RegisterApiControllers(Assembly.GetExecutingAssembly());&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    builder.RegisterType&amp;lt;DefaultCommandBus&amp;gt;().As&amp;lt;ICommandBus&amp;gt;()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        .InstancePerApiRequest();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    builder.RegisterType&amp;lt;UnitOfWork&amp;gt;().As&amp;lt;IUnitOfWork&amp;gt;()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        .InstancePerApiRequest();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;    builder.RegisterType&amp;lt;DatabaseFactory&amp;gt;().As&amp;lt;IDatabaseFactory&amp;gt;()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        .InstancePerApiRequest();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;    builder.RegisterAssemblyTypes(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(CategoryRepository)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;   .Assembly).Where(t =&amp;gt; t.Name.EndsWith(&lt;span class="str"&gt;&amp;quot;Repository&amp;quot;&lt;/span&gt;))&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;    .AsImplementedInterfaces().InstancePerApiRequest();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;    var services = Assembly.Load(&lt;span class="str"&gt;&amp;quot;EFMVC.Domain&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;    builder.RegisterAssemblyTypes(services)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;    .AsClosedTypesOf(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(ICommandHandler&amp;lt;&amp;gt;))&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;        .InstancePerApiRequest();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;    builder.RegisterAssemblyTypes(services)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;    .AsClosedTypesOf(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(IValidationHandler&amp;lt;&amp;gt;))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;        .InstancePerApiRequest();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;    var container = builder.Build();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;    &lt;span class="rem"&gt;// Set the WebApi dependency resolver.&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;    var resolver = &lt;span class="kwrd"&gt;new&lt;/span&gt; AutofacWebApiDependencyResolver(container);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;    configuration.ServiceResolver.SetResolver(resolver);             &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;







.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The RegisterApiControllers method will scan the given assembly and register the all ApiController classes. This method will look for types that derive from IHttpController with name convention end with “Controller”. The InstancePerApiRequest method specifies the life time of the component for once per API controller invocation. The GlobalConfiguration.Configuration provides a ServiceResolver class which can be use set dependency&lt;/font&gt; &lt;font size="2"&gt;resolver for ASP.NET Web API. In our example, we are using AutofacWebApiDependencyResolver class provided by Autofac.WebApi to set the dependency resolver.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The Run method of Bootstrapper class is calling from Application_Start method of Global.asax.cs. &lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Application_Start()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    AreaRegistration.RegisterAllAreas();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    RegisterGlobalFilters(GlobalFilters.Filters);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    RegisterRoutes(RouteTable.Routes);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    BundleTable.Bundles.RegisterTemplateBundles();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    &lt;span class="rem"&gt;//Call Autofac DI configurations&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    Bootstrapper.Run();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;} &lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;







.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;font size="2"&gt;&lt;strong&gt;Autofac.Mvc4&lt;/strong&gt;&lt;/font&gt; 

&lt;p&gt;&lt;font size="2"&gt;The Autofac framework’s integration with ASP.NET MVC has updated for ASP.NET MVC 4. The NuGet package &lt;a href="https://nuget.org/packages/Autofac.Mvc4/" target="_blank"&gt;Autofac.Mvc4&lt;/a&gt; provides the dependency injection support for ASP.NET MVC 4. There is not any syntax change between &lt;a href="https://nuget.org/packages/Autofac.Mvc3/" target="_blank"&gt;Autofac.Mvc3&lt;/a&gt; and &lt;a href="https://nuget.org/packages/Autofac.Mvc4/" target="_blank"&gt;Autofac.Mvc4&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Source Code&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;I have updated my &lt;a href="http://efmvc.codeplex.com/" target="_blank"&gt;EFMVC&lt;/a&gt; app with Autofac.WebApi for applying dependency injection for it’s ASP.NET Web API services. EFMVC app also updated to &lt;/font&gt;Autofac.Mvc4 for it’s ASP.NET MVC 4 web app. The above code sample is taken from the EFMVC app. You &lt;font size="2"&gt;can download the source code of EFMVC app from &lt;a href="http://efmvc.codeplex.com/"&gt;http://efmvc.codeplex.com/&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8372579" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/bV5i9fgAF7Q" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/IoC/default.aspx">IoC</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net+4/default.aspx">.Net 4</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/ASP.NET+MVC+4/default.aspx">ASP.NET MVC 4</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Autofac/default.aspx">Autofac</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/ASP.NET+Web+API/default.aspx">ASP.NET Web API</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/04/01/dependency-injection-in-asp-net-web-api-using-autofac.aspx</feedburner:origLink></item><item><title>Windows Azure PowerShell for Node.js</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/iwxYSO5UE8E/windows-azure-powershell-for-node-js.aspx</link><pubDate>Tue, 20 Mar 2012 07:59:28 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8355304</guid><dc:creator>shiju</dc:creator><slash:comments>9</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8355304</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8355304</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/03/20/windows-azure-powershell-for-node-js.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2"&gt;The Windows Azure PowerShell for Node.js is a command-line tool that&amp;#160; allows the Node developers to build and deploy Node.js apps in Windows Azure using Windows PowerShell cmdlets. Using Windows Azure PowerShell for Node.js, you can develop, test, deploy and manage Node based hosted service in Windows Azure. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;For getting the PowerShell for Node.js, click All Programs, Windows Azure SDK Node.js and run&amp;#160; Windows Azure PowerShell for Node.js, as Administrator.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_69994491.png"&gt;&lt;font size="2"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_6E2F4F4B.png" width="244" height="206" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The followings are the few PowerShell cmdlets that lets you to work with Node.js apps in Windows Azure&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Create New Hosted Service&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;New-AzureService &amp;lt;HostedServiceName&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The below cmdlet will created a Windows Aazure hosted service named NodeOnAzure in the folder C:\nodejs and this will also create ServiceConfiguration.Cloud.cscfg, ServiceConfiguration.Local.cscfg and ServiceDefinition.csdef and deploymentSettings.json files for the hosted service.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;PS C:\nodejs&amp;gt; New-AzureService NodeOnAzure&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The below picture shows the files after creating the hosted service&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_5165B469.png"&gt;&lt;font size="2"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_4F48B5A0.png" width="628" height="211" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Create Web Role&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Add-AzureNodeWebRole &amp;lt;RoleName&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The following cmdlet will create a hosted service named MyNodeApp along with web.config file.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;PS C:\nodejs\NodeOnAzure&amp;gt; Add-AzureNodeWebRole MyNodeApp&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The below picture shows the files after creating the web role app.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_5DC3B1C5.png"&gt;&lt;font size="2"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_6978F8F7.png" width="646" height="207" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Install Node Module&lt;/strong&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;npm install &amp;lt;NodeModule&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The following command will install Node Module Express onto your web role app.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;PS C:\nodejs\NodeOnAzure\MyNodeApp&amp;gt; npm install Express&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_6CCA6AD2.png"&gt;&lt;font size="2"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_69D5061F.png" width="597" height="331" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Run Windows Azure Apps Locally in the Emulator&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;pre&gt;&lt;font size="2" face="Arial"&gt; Start-AzureEmulator -launch&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;&lt;font size="2"&gt;The following cmdlet will create a local package and run Windows Azure app locally in the emulator&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;PS C:\nodejs\NodeOnAzure\MyNodeApp&amp;gt; Start-AzureEmulator -launch&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_7C79DA09.png"&gt;&lt;font size="2"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_741604B2.png" width="494" height="112" /&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Stop&lt;/strong&gt; &lt;strong&gt;Windows Azure Emulator&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Stop-AzureEmulator &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The following cmdlet will stop your Windows Azure in the emulator.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;PS C:\nodejs\NodeOnAzure\MyNodeApp&amp;gt; Stop-AzureEmulator &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Download Windows Azure Publishing Settings&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Get-AzurePublishSettings&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The following cmdlet will redirect to Windows Azure portal where we can download Windows Azure publish settings&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;PS C:\nodejs\NodeOnAzure\MyNodeApp&amp;gt; Get-AzurePublishSettings&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Import Windows Azure Publishing Settings&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Import-AzurePublishSettings &amp;lt;Location of .publishSettings file&amp;gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The following cmdlet will import the publish settings file from the location c:\nodejs&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;PS C:\nodejs\NodeOnAzure\MyNodeApp&amp;gt;&amp;#160; Import-AzurePublishSettings c:\nodejs\shijuvar.publishSettings&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Publish Apps to Windows Azure&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Publish-AzureService –name &amp;lt;Name&amp;gt; –location &amp;lt;Location of Data centre&amp;gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The following cmdlet will publish the app to Windows Azure with name “NodeOnAzure” in the location Southeast Asia. Please keep in mind that the service name should be unique.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;PS C:\nodejs\NodeOnAzure\MyNodeApp&amp;gt; Publish-AzureService –name NodeonAzure –location &amp;quot;Southeast Asia” –launch&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Stop Windows Azure Service&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Stop-AzureService&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The following cmdlet will stop your service which you have deployed previously.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;PS C:\nodejs\NodeOnAzure\MyNodeApp&amp;gt; Stop-AzureService&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Remove Windows Azure Service&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Remove-AzureService&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The following cmdlet will remove your service from Windows Azure.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;PS C:\nodejs\NodeOnAzure\MyNodeApp&amp;gt; Remove-AzureService&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Quick Summary for PowerShell cmdlets&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;table border="1" cellspacing="1" cellpadding="2" width="542"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="234"&gt;&lt;font size="2"&gt;Create&amp;#160; a new Hosted Service&lt;/font&gt;&lt;/td&gt;

      &lt;td valign="top" width="303"&gt;&lt;font size="2"&gt;New-AzureService &amp;lt;HostedServiceName&amp;gt;&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="234"&gt;&lt;font size="2"&gt;Create a Web Role&lt;/font&gt;&lt;/td&gt;

      &lt;td valign="top" width="303"&gt;&lt;font size="2"&gt;Add-AzureNodeWebRole &amp;lt;RoleName&amp;gt;&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="234"&gt;&lt;font size="2"&gt;Install Node Module&lt;/font&gt;&lt;/td&gt;

      &lt;td valign="top" width="303"&gt;&lt;font size="2"&gt;npm install &amp;lt;NodeModule&amp;gt;&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="234"&gt;&lt;font size="2"&gt;Running Windows Azure Apps Locally in Emulator&lt;/font&gt;&lt;/td&gt;

      &lt;td valign="top" width="303"&gt;&lt;font size="2"&gt;Start-AzureEmulator -launch&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="234"&gt;&lt;font size="2"&gt;Stop Windows Azure Emulator&lt;/font&gt;&lt;/td&gt;

      &lt;td valign="top" width="303"&gt;&lt;font size="2"&gt;Stop-AzureEmulator &lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="234"&gt;&lt;font size="2"&gt;Download Windows Azure Publishing Settings&lt;/font&gt;&lt;/td&gt;

      &lt;td valign="top" width="303"&gt;&lt;font size="2"&gt;Get-AzurePublishSettings&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="234"&gt;&lt;font size="2"&gt;Import Windows Azure Publishing Settings&lt;/font&gt;&lt;/td&gt;

      &lt;td valign="top" width="303"&gt;&lt;font size="2"&gt;Import-AzurePublishSettings &amp;lt;Location of .publishSettings file&amp;gt;&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="234"&gt;&lt;font size="2"&gt;Publish Apps to Windows Azure&lt;/font&gt;&lt;/td&gt;

      &lt;td valign="top" width="303"&gt;&lt;font size="2"&gt;Publish-AzureService –name &amp;lt;Name&amp;gt; –location &amp;lt;Location of Data centre&amp;gt;&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="234"&gt;&lt;font size="2"&gt;Stop Windows Azure Service&lt;/font&gt;&lt;/td&gt;

      &lt;td valign="top" width="303"&gt;&lt;font size="2"&gt;Stop-AzureService&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="234"&gt;&lt;font size="2"&gt;Remove Windows Azure Service&lt;/font&gt;&lt;/td&gt;

      &lt;td valign="top" width="303"&gt;&lt;font size="2"&gt;Remove-AzureService&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8355304" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/iwxYSO5UE8E" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure/default.aspx">Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Node.js/default.aspx">Node.js</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/03/20/windows-azure-powershell-for-node-js.aspx</feedburner:origLink></item><item><title>Using Node Package Manager in Cloud9 IDE</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/ducTy3ehSDM/using-node-package-manager-in-cloud9-ide.aspx</link><pubDate>Wed, 14 Mar 2012 09:26:11 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8346184</guid><dc:creator>shiju</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8346184</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8346184</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/03/14/using-node-package-manager-in-cloud9-ide.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;NPM - Package Manager for Node.js&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;npm is a package manager for node that is run through command-line interface. It can use it to install and publish your node programs. npm manages dependencies for an application.Node packages are represented as package.json files. The npm is a very similar like NuGet package manager for .NET.   &lt;br /&gt;Using npm, you can quickly find node packages, download them, install them, and manage packages you have already installed.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Cloud9 IDE supports Node Package Manager&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;With Cloud9 IDE, you can install&amp;#160; node modules to your Node.js apps using npm. You can use the link &lt;a href="http://search.npmjs.org/"&gt;http://search.npmjs.org/&lt;/a&gt; to find out Node packages. To using npm from Cloud9 IDE, go to the text box at the end of the IDE and type the following command, and enter.&lt;/p&gt;  &lt;p&gt;npm install &amp;lt;packagename&amp;gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/npm_4C173AD0.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="npm" border="0" alt="npm" src="http://weblogs.asp.net/blogs/shijuvarghese/npm_thumb_67F849FB.png" width="385" height="391" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the above picture, we are installing node module express.&amp;#160; This will shows the following in the console&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/npm_express_2F8A2323.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="npm_express" border="0" alt="npm_express" src="http://weblogs.asp.net/blogs/shijuvarghese/npm_express_thumb_4DF4640C.png" width="388" height="246" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The below picture shows node modules installed into our Node.js project.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/npm_modules_04820F51.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="npm_modules" border="0" alt="npm_modules" src="http://weblogs.asp.net/blogs/shijuvarghese/npm_modules_thumb_6890DA58.png" width="394" height="387" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8346184" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/ducTy3ehSDM" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Node.js/default.aspx">Node.js</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/03/14/using-node-package-manager-in-cloud9-ide.aspx</feedburner:origLink></item><item><title>Building and Deploying Node.js Apps to Windows Azure using Cloud9 IDE</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/AK0ad1utICE/building-and-deploying-node-js-apps-to-windows-azure-using-cloud9-ide.aspx</link><pubDate>Thu, 08 Mar 2012 10:20:46 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8333693</guid><dc:creator>shiju</dc:creator><slash:comments>16</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8333693</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8333693</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/03/08/building-and-deploying-node-js-apps-to-windows-azure-using-cloud9-ide.aspx#comments</comments><description>&lt;p&gt;&lt;font size="2"&gt;In this post, I will demonstrate how to building&amp;#160; Node.js apps using Cloud9 IDE ad deploying Node.js apps to Windows Azure from the Cloud9 IDE.&amp;#160; Cloud9 IDE is a cross-platform, browser-based development environment for JavaScript and Node.js apps which is integrates with GitHub and BitBucket repository services. Cloud9 IDE is the most popular developer tool among the Node developers. Since Cloud9 IDE is working and running on the browser, developers can work from any OS platform. Using with Cloud IDE, you can build and deploy Node.js apps to Windows Azure. The Cloud9 IDE can access from &lt;/font&gt;&lt;a href="http://c9.io/"&gt;&lt;font size="2"&gt;http://c9.io/&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. Cloud9 IDE provides a free subscription as well as a paid subscription with more features.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Node.js&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Node.js is a server-side JavaScript platform for&amp;#160; building high performance scalable network programs. Node.js is built on the top of Google's JavaScript runtime engine V8 which is used in Google Chrome.&amp;#160; Node.js uses an event-driven I/O model which provides the ability to handle thousands of parallel operations with greater performance. Node.js is popular for its performance and the Node.js apps are executed on the V8 runtime engine. Node.js lets the developers to write JavaScript programs on the server-side and its provides a JavaScript API to access the network and file systems.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Node.js for Windows Azure&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Windows Azure is a powerful cloud platform which provides the first class support for Node.js apps. The Windows Azure SDK for Node.js provides the all support to develop and deploy Node.js apps to Windows Azure. With Windows Azure SDK for Node.js, you can deploy Node.js apps to Windows Azure as a Web Role.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Working with Cloud9 IDE&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;strong&gt;&lt;/strong&gt;  &lt;p&gt;   &lt;br /&gt;&lt;font size="2"&gt;The Cloud9 IDE allows the developers to build and run Node.js apps. Let me explain how to develop Node apps from the Cloud9 IDE in the following steps. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;Creating a New Project&lt;/u&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;In the Cloud9 IDE, select the &lt;strong&gt;Create New Project&lt;/strong&gt; from My Projects tab. In the Create a new project dialog, enter a project name and click the Create button to create a new project as shown in the below pictures.&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_7BD17DEE.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_64E286A5.png" width="462" height="334" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The Cloud9 IDE&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_6180EEFD.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_70681E17.png" width="476" height="351" /&gt;&lt;/a&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Create a New Project Dialog&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;font size="2"&gt;Creating and Editing files in Cloud9 IDE&lt;/font&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;After creating a project in Cloud9, click &lt;strong&gt;Start Editing&lt;/strong&gt; as shown in the below picture. This will enable you create and edit files in the Cloud9 IDE.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_5B29F2A2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_164DA8A1.png" width="507" height="331" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;You can add a new file by select &lt;b&gt;New File&lt;/b&gt; from File menu. This will add a new tab titled *Untitled1.&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_39BA2739.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_68BC6310.png" width="505" height="302" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;To save your file, select &lt;strong&gt;Save As&lt;/strong&gt; option from the File menu. This will show the below dialog box, where you can enter the file name and save it to the project created in Cloud9.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_1A675A99.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_69F0D622.png" width="510" height="384" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;font size="2"&gt;Creating a Node.js App in Cloud9 IDE&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;font size="2"&gt;Our sample Node.js application is a simple app which provides request handlers for the following three types of HTTP requests. &lt;/font&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;font size="2"&gt;Request handler for Home page which will provide a HTML form with two form fields. &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2"&gt;Request handler for handling and processing posted data submitted from the HTML form. &lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2"&gt;Request handler for Http 404 No Found requests. &lt;/font&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;font size="2"&gt;In this app, we will be creating a HTTP server which will be listen for HTTP requests. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; http = require(&lt;span class="str"&gt;'http'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; querystring = require(&lt;span class="str"&gt;'querystring'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; utils = require(&lt;span class="str"&gt;'util'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; url = require(&lt;span class="str"&gt;&amp;quot;url&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; port=process.env.PORT;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt; &lt;span class="kwrd"&gt;var&lt;/span&gt; server = http.createServer(&lt;span class="kwrd"&gt;function&lt;/span&gt;(req, res) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;  &lt;span class="kwrd"&gt;switch&lt;/span&gt; (req.url) { &lt;span class="rem"&gt;//checking the request url&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;case&lt;/span&gt; &lt;span class="str"&gt;'/'&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;      homePageHandler (req, res); &lt;span class="rem"&gt;//handler for home page&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;      &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    &lt;span class="kwrd"&gt;case&lt;/span&gt; &lt;span class="str"&gt;'/register'&lt;/span&gt;:  &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;      registerFormHandler (req, res);&lt;span class="rem"&gt;//hamdler for register&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;      &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    &lt;span class="kwrd"&gt;default&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;      nofoundHandler (req, res);&lt;span class="rem"&gt;// handler for 404 not found&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;      &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;  }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;});&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;server.listen(port);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;&lt;span class="rem"&gt;//function to display the html form&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; homePageHandler (req, res) {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;  res.writeHead(200, {&lt;span class="str"&gt;'Content-Type'&lt;/span&gt;: &lt;span class="str"&gt;'text/html'&lt;/span&gt;});&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;   &lt;span class="kwrd"&gt;var&lt;/span&gt; body = &lt;span class="str"&gt;'&amp;lt;html&amp;gt;'&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;    &lt;span class="str"&gt;'&amp;lt;head&amp;gt;'&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;    &lt;span class="str"&gt;'&amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; '&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;    &lt;span class="str"&gt;'charset=UTF-8&amp;quot; /&amp;gt;'&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;    &lt;span class="str"&gt;'&amp;lt;/head&amp;gt;'&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;    &lt;span class="str"&gt;'&amp;lt;body&amp;gt;'&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;    &lt;span class="str"&gt;'&amp;lt;form action=&amp;quot;/register&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;'&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;    &lt;span class="str"&gt;'Name:&amp;lt;input type=text value=&amp;quot;&amp;quot; name=&amp;quot;name&amp;quot; size=15&amp;gt;&amp;lt;/br&amp;gt;'&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;    &lt;span class="str"&gt;'Email:&amp;lt;input type=text value=&amp;quot;&amp;quot; name=&amp;quot;email&amp;quot; size=15&amp;gt;&amp;lt;/br&amp;gt;'&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;    &lt;span class="str"&gt;'&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Submit&amp;quot; /&amp;gt;'&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;    &lt;span class="str"&gt;'&amp;lt;/form&amp;gt;'&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;    &lt;span class="str"&gt;'&amp;lt;/body&amp;gt;'&lt;/span&gt;+&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;    &lt;span class="str"&gt;'&amp;lt;/html&amp;gt;'&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;&lt;span class="rem"&gt;//response content&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;res.end(body);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;}&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;&lt;span class="rem"&gt;//handler for Post request&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; registerFormHandler (req, res) {   &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;&lt;span class="rem"&gt;//var pathname = url.parse(req.url).pathname;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;&lt;span class="rem"&gt;//console.log(&amp;quot;Request for &amp;quot; + pathname + &amp;quot; received.&amp;quot;);    &lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  45:  &lt;/span&gt; &lt;span class="kwrd"&gt;var&lt;/span&gt; postData = &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;    &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  46:  &lt;/span&gt;  req.on(&lt;span class="str"&gt;'data'&lt;/span&gt;, &lt;span class="kwrd"&gt;function&lt;/span&gt;(chunk) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  47:  &lt;/span&gt;      &lt;span class="rem"&gt;// append the current chunk of data to the postData variable&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  48:  &lt;/span&gt;      postData += chunk.toString();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  49:  &lt;/span&gt;    });   &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  50:  &lt;/span&gt;    req.on(&lt;span class="str"&gt;'end'&lt;/span&gt;, &lt;span class="kwrd"&gt;function&lt;/span&gt;() {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  51:  &lt;/span&gt;    &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  52:  &lt;/span&gt;   &lt;span class="rem"&gt;// doing something with the posted data&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  53:  &lt;/span&gt;      res.writeHead(200, &lt;span class="str"&gt;&amp;quot;OK&amp;quot;&lt;/span&gt;, {&lt;span class="str"&gt;'Content-Type'&lt;/span&gt;: &lt;span class="str"&gt;'text/html'&lt;/span&gt;});      &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  54:  &lt;/span&gt;      &lt;span class="rem"&gt;// parse the posted data&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  55:  &lt;/span&gt;      &lt;span class="kwrd"&gt;var&lt;/span&gt; decodedBody = querystring.parse(postData);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  56:  &lt;/span&gt;      &lt;span class="rem"&gt;// output the decoded data to the HTTP response          &lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  57:  &lt;/span&gt;      res.write(&lt;span class="str"&gt;'&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Post data&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;pre&amp;gt;'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  58:  &lt;/span&gt;      res.write(utils.inspect(decodedBody));    &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  59:  &lt;/span&gt;      res.write(&lt;span class="str"&gt;'&amp;lt;/pre&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;'&lt;/span&gt;);       &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  60:  &lt;/span&gt;      res.end();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  61:  &lt;/span&gt;    });&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  62:  &lt;/span&gt;}&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  63:  &lt;/span&gt;&lt;span class="rem"&gt;//==========Error handler==========&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  64:  &lt;/span&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; nofoundHandler(req, res) {    &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  65:  &lt;/span&gt;  res.writeHead(404, {&lt;span class="str"&gt;'Content-Type'&lt;/span&gt;: &lt;span class="str"&gt;'text/plain'&lt;/span&gt;});&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  66:  &lt;/span&gt;  res.end(&lt;span class="str"&gt;'404 Error - Request handler not found'&lt;/span&gt;); &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  67:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;In the above section of the program, we are importing different Node modules to our program.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; http = require(&lt;span class="str"&gt;'http'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; querystring = require(&lt;span class="str"&gt;'querystring'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; utils = require(&lt;span class="str"&gt;'util'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; url = require(&lt;span class="str"&gt;&amp;quot;url&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;
  &lt;br /&gt;&lt;font size="2"&gt;In the Node.js sample app, we are creating a HTTP server which will be listening for HTTP requests. Based on the request url, the server will call the corresponding request handlers.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; server = http.createServer(&lt;span class="kwrd"&gt;function&lt;/span&gt;(req, res) {&lt;/pre&gt;

  &lt;pre&gt;  &lt;span class="kwrd"&gt;switch&lt;/span&gt; (req.url) { &lt;span class="rem"&gt;//checking the request url&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;case&lt;/span&gt; &lt;span class="str"&gt;'/'&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre&gt;      homePageHandler (req, res); &lt;span class="rem"&gt;//handler for home page&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;case&lt;/span&gt; &lt;span class="str"&gt;'/register'&lt;/span&gt;:  &lt;/pre&gt;

  &lt;pre class="alt"&gt;      registerFormHandler (req, res);&lt;span class="rem"&gt;//hamdler for register&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;default&lt;/span&gt;:&lt;/pre&gt;

  &lt;pre&gt;      nofoundHandler (req, res);&lt;span class="rem"&gt;// handler for 404 not found&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;  }&lt;/pre&gt;

  &lt;pre class="alt"&gt;});&lt;/pre&gt;

  &lt;pre&gt;server.listen(port);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Running the App from Cloud9 IDE&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;You can run the apps from Cloud9 IDE by click &lt;strong&gt;Debug &lt;/strong&gt;button from the toolbar&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/debug_74CDB76A.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="debug" border="0" alt="debug" src="http://weblogs.asp.net/blogs/shijuvarghese/debug_thumb_7DDA42EB.png" width="399" height="90" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The debugger will show an output window where you can get a URL generated by the Cloud9 IDE to access your application.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/debug_console_104293A1.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="debug_console" border="0" alt="debug_console" src="http://weblogs.asp.net/blogs/shijuvarghese/debug_console_thumb_4E5BAE52.png" width="485" height="207" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;Running App in Browser&lt;/u&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The below picture shows the output of the request for home page&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/home_page_36E0FA21.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="home_page" border="0" alt="home_page" src="http://weblogs.asp.net/blogs/shijuvarghese/home_page_thumb_6DDAD85A.png" width="474" height="231" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The below picture shows the output of the request for the form action register. This will show the posted data submitted from a HTML form.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/register_posteddata_6B51A69C.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="register_posteddata" border="0" alt="register_posteddata" src="http://weblogs.asp.net/blogs/shijuvarghese/register_posteddata_thumb_6934A7D3.png" width="472" height="255" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Deploying Node.js App to Windows Azure using Cloud9 IDE&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;You can easily create a Deployment for Windows Azure from Cloud9 IDE itself. To create a deployment for Windows Azure, Select Deploy and click &lt;strong&gt;Create a Deploy Server&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/select_deploy_1BB80546.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="select_deploy" border="0" alt="select_deploy" src="http://weblogs.asp.net/blogs/shijuvarghese/select_deploy_thumb_23EC2ADD.png" width="377" height="296" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;The option for Create a Deploy Server will show the below dialog box where you can choose the deployment type as Windows Azure for deploying apps to Windows Azure. This will show the below window for download and upload the Windows Azure publish settings.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/deploy_target_azure_3C9B5220.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="deploy_target_azure" border="0" alt="deploy_target_azure" src="http://weblogs.asp.net/blogs/shijuvarghese/deploy_target_azure_thumb_13440A22.png" width="370" height="319" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;After uploading the Windows Azure publish settings, click &lt;strong&gt;Create new &lt;/strong&gt;option to create a new hosted service in Windows Azure. You can also able to choose an existing hosted service deployed in Windows Azure. The below window for new hosted service allows you put configurations for your Windows Azure hosted service. After putting the configurations for Windows Azure, click the Create button for creating a new deployment for Windows Azure. This will create a new deployment and this will show a deployment under the Deploy tab.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/add_deploy_target_294A75B4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="add_deploy_target" border="0" alt="add_deploy_target" src="http://weblogs.asp.net/blogs/shijuvarghese/add_deploy_target_thumb_2DE0806E.png" width="354" height="370" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;font size="2"&gt;Deploying the App to Windows Azure&lt;/font&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;Under the Deploy tab of Cloud9 IDE, you can see all the deployments you have created earlier. For deploying our Node.js app to Windows Azure, click the deployment we have created previously.This will show the below dialog.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/deploy_18A254F9.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="deploy" border="0" alt="deploy" src="http://weblogs.asp.net/blogs/shijuvarghese/deploy_thumb_59ED5792.png" width="422" height="284" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;For the first time deployment for a new hosted service, it will ask for creating a new &lt;strong&gt;web.config&lt;/strong&gt; and .&lt;strong&gt;csdef&lt;/strong&gt; file as shown in the below pictures. Select Yes for crating a new web.config and .csdef file.&lt;/font&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/no_webconfig_76A6CCA7.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="no_webconfig" border="0" alt="no_webconfig" src="http://weblogs.asp.net/blogs/shijuvarghese/no_webconfig_thumb_025C13DA.png" width="426" height="164" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/no_csdef_0685EB9F.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="no_csdef" border="0" alt="no_csdef" src="http://weblogs.asp.net/blogs/shijuvarghese/no_csdef_thumb_6B6D1C90.png" width="426" height="159" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;After creating the web.config and .csdef file, click the &lt;strong&gt;Deploy &lt;/strong&gt;button for deploy our Node.js app to Windows Azure. This will successfully deploy our Node.js app to Windows Azure.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Summary&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;font size="2"&gt;In this post, we have created a simple Node.js app with request handlers within the Cloud9 IDE and later deployed it to Windows Azure using Cloud9 IDE. The Windows Azure SDK for Node.js provides the all support to develop and deploy Node.js apps to Windows Azure. The Cloud9 IDE provides the greater support to build and deploy apps to Windows Azure.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8333693" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/AK0ad1utICE" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure/default.aspx">Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Node.js/default.aspx">Node.js</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/03/08/building-and-deploying-node-js-apps-to-windows-azure-using-cloud9-ide.aspx</feedburner:origLink></item><item><title>EFMVC App Migrated to ASP.NET MVC 4</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/eAv_URtXGR8/efmvc-app-migrated-to-asp-net-mvc-4.aspx</link><pubDate>Thu, 01 Mar 2012 07:04:52 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8320587</guid><dc:creator>shiju</dc:creator><slash:comments>8</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8320587</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8320587</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/03/01/efmvc-app-migrated-to-asp-net-mvc-4.aspx#comments</comments><description>&lt;p&gt;I have upgraded my &lt;a href="http://efmvc.codeplex.com/" target="_blank"&gt;EFMVC&lt;/a&gt; app from ASP.NET MVC 3 to ASP.NET MVC 4 Beta. EFMVC is a demo web app initially built for demonstrating ASP.NET MVC and EF Code First. Now I am planning to add more features onto EFMVC and want to add cloud specific features with Windows Azure. You can expect more implementations in future releases.&lt;/p&gt;  &lt;p&gt;The current migration does not contains any major code changes. I have added a Windows Azure web role and will add some cloud specific features on later. The migration process was very smooth and the &lt;a href="http://code.google.com/p/autofac/wiki/Mvc3Integration" target="_blank"&gt;Autofac.MVC3&lt;/a&gt; has been working with ASP.NET MVC 4 app without any issue.&amp;#160; But I am having some issues with&amp;#160; Autofac.MVC3 package while integrating with ASP.NET Web API services. I have used the current AutofacDependencyResolver class to integrating with DependencyResolver. The ASP.NET Web API expects a System.Web.Http.Services.IDependencyResolver implementation instead of System.Web.Mvc.IDependencyResolver which is used by ASP.NET MVC.&lt;/p&gt;  &lt;p&gt;The below is the updated feature list of the EFMVC app&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Windows Azure Web Role&lt;/li&gt;    &lt;li&gt;CRUD demo in ASP.NET MVC 4 with Entity Framework 4.3 Code First &lt;/li&gt;    &lt;li&gt;Generic repository for Entity Framework Code First&lt;/li&gt;    &lt;li&gt;Repository Pattern and Unit of Work&lt;/li&gt;    &lt;li&gt;Dependency Injection using Autofac&lt;/li&gt;    &lt;li&gt;Razor View Engine&lt;/li&gt;    &lt;li&gt;Solution Architectures using Commands(write operations), Command Handlers, Command Dispatcher&lt;/li&gt;    &lt;li&gt;ASP.NET Web API&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You can download the source from &lt;a href="http://efmvc.codeplex.com/"&gt;http://efmvc.codeplex.com/&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8320587" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/eAv_URtXGR8" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/jQuery/default.aspx">jQuery</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net+4/default.aspx">.Net 4</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure/default.aspx">Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/ASP.NET+MVC+4/default.aspx">ASP.NET MVC 4</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/CQRS/default.aspx">CQRS</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Autofac/default.aspx">Autofac</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/ASP.NET+Web+API/default.aspx">ASP.NET Web API</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/03/01/efmvc-app-migrated-to-asp-net-mvc-4.aspx</feedburner:origLink></item><item><title>ASP.NET MVC 4 Beta Released</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/ee6ubQ4-OGc/asp-net-mvc-4-beta-released.aspx</link><pubDate>Fri, 17 Feb 2012 14:44:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8298516</guid><dc:creator>shiju</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8298516</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8298516</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/02/17/asp-net-mvc-4-beta-released.aspx#comments</comments><description>&lt;p&gt; Microsoft has announced the availability of ASP.NET MVC 4 Beta. You can get the all details on ASP.NET MVC 4 Beta at &lt;a href="http://www.asp.net/mvc/mvc4"&gt;http://www.asp.net/mvc/mvc4&lt;/a&gt;. The greatest new feature of ASP.NET MVC 4 Beta is the addition of ASP.NET Web API which lets the developers to build REST based services which can be easily consume from variety of clients including browsers and mobile devices. These HTTP services are ideal for clients which are building by using Ajax and following a highly responsive UI.&lt;/p&gt;  &lt;p&gt;For more details on ASP.NET Web API, you can watch the presentation taken by Daniel Roth, a Senior Program Manager at Microsoft, from &lt;a href="http://www.c4mvc.net/meeting/?id=25" target="_blank"&gt;here&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;The following are the other new features included in the ASP.NET MVC 4&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Refreshed and modernized default project templates&lt;/li&gt;    &lt;li&gt;New mobile project template&lt;/li&gt;    &lt;li&gt;Many new features to support mobile apps&lt;/li&gt;    &lt;li&gt;Recipes to customize code generation&lt;/li&gt;    &lt;li&gt;Enhanced support for asynchronous methods&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The new ASP.NET MVC 4 project dialog is shown below&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/shijuvarghese/image_59B78B1B.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/shijuvarghese/image_thumb_38FFDA02.png" width="512" height="442" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8298516" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/ee6ubQ4-OGc" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net+4/default.aspx">.Net 4</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/ASP.NET+MVC+4/default.aspx">ASP.NET MVC 4</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/ASP.NET+Web+API/default.aspx">ASP.NET Web API</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/02/17/asp-net-mvc-4-beta-released.aspx</feedburner:origLink></item><item><title>Microsoft Reduces Prices on SQL Azure Cloud Storage</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/vo3oQWKTr6w/microsoft-reduces-prices-on-sql-azure-cloud-storage.aspx</link><pubDate>Thu, 16 Feb 2012 14:20:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8297646</guid><dc:creator>shiju</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8297646</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8297646</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/02/16/microsoft-reduces-prices-on-sql-azure-cloud-storage.aspx#comments</comments><description>&lt;p&gt;Microsoft has reduced the price of SQL Azure storage which will greatly attract customers to migrating their apps to Windows Azure. The newly announced&amp;nbsp; price of SQL Azure decreases 48 percentages to 75 percentages of cost from the previous cost. &lt;/p&gt;&lt;p&gt;The new price details are given below&lt;br&gt;&lt;/p&gt;&lt;table style="margin-left: 1px; color: rgb(51, 51, 51); font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(224, 224, 224); width: 518px; height: 295px; " border="1" cellpadding="2" cellspacing="2"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="42"&gt;&lt;p style="margin-top: 0px; "&gt;&lt;b&gt;GB&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="58"&gt;&lt;p style="margin-top: 0px; "&gt;&lt;b&gt;Previous Pricing&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="47"&gt;&lt;p style="margin-top: 0px; "&gt;&lt;b&gt;New Pricing&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="51"&gt;&lt;p style="margin-top: 0px; "&gt;&lt;b&gt;New Price/GB&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="63"&gt;&lt;p style="margin-top: 0px; "&gt;&lt;b&gt;Total % Decrease&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="42"&gt;&lt;p style="margin-top: 0px; "&gt;5&lt;/p&gt;&lt;/td&gt;&lt;td width="58"&gt;&lt;p style="margin-top: 0px; "&gt;$49.95&lt;/p&gt;&lt;/td&gt;&lt;td width="47"&gt;&lt;p style="margin-top: 0px; "&gt;$25.99&lt;/p&gt;&lt;/td&gt;&lt;td width="51"&gt;&lt;p style="margin-top: 0px; "&gt;$5.20&lt;/p&gt;&lt;/td&gt;&lt;td width="63"&gt;&lt;p style="margin-top: 0px; "&gt;48%&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="42"&gt;&lt;p style="margin-top: 0px; "&gt;10&lt;/p&gt;&lt;/td&gt;&lt;td width="58"&gt;&lt;p style="margin-top: 0px; "&gt;$99.99&lt;/p&gt;&lt;/td&gt;&lt;td width="47"&gt;&lt;p style="margin-top: 0px; "&gt;$45.99&lt;/p&gt;&lt;/td&gt;&lt;td width="51"&gt;&lt;p style="margin-top: 0px; "&gt;$4.60&lt;/p&gt;&lt;/td&gt;&lt;td width="63"&gt;&lt;p style="margin-top: 0px; "&gt;54%&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="42"&gt;&lt;p style="margin-top: 0px; "&gt;25&lt;/p&gt;&lt;/td&gt;&lt;td width="58"&gt;&lt;p style="margin-top: 0px; "&gt;$299.97&lt;/p&gt;&lt;/td&gt;&lt;td width="47"&gt;&lt;p style="margin-top: 0px; "&gt;$75.99&lt;/p&gt;&lt;/td&gt;&lt;td width="51"&gt;&lt;p style="margin-top: 0px; "&gt;$3.04&lt;/p&gt;&lt;/td&gt;&lt;td width="63"&gt;&lt;p style="margin-top: 0px; "&gt;75%&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="42"&gt;&lt;p style="margin-top: 0px; "&gt;50&lt;/p&gt;&lt;/td&gt;&lt;td width="58"&gt;&lt;p style="margin-top: 0px; "&gt;$499.95*&lt;/p&gt;&lt;/td&gt;&lt;td width="47"&gt;&lt;p style="margin-top: 0px; "&gt;$125.99&lt;/p&gt;&lt;/td&gt;&lt;td width="51"&gt;&lt;p style="margin-top: 0px; "&gt;$2.52&lt;/p&gt;&lt;/td&gt;&lt;td width="63"&gt;&lt;p style="margin-top: 0px; "&gt;75%&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="42"&gt;&lt;p style="margin-top: 0px; "&gt;100&lt;/p&gt;&lt;/td&gt;&lt;td width="58"&gt;&lt;p style="margin-top: 0px; "&gt;$499.95 *&lt;/p&gt;&lt;/td&gt;&lt;td width="47"&gt;&lt;p style="margin-top: 0px; "&gt;$175.99&lt;/p&gt;&lt;/td&gt;&lt;td width="51"&gt;&lt;p style="margin-top: 0px; "&gt;$1.76&lt;/p&gt;&lt;/td&gt;&lt;td width="63"&gt;&lt;p style="margin-top: 0px; "&gt;65%&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="42"&gt;&lt;p style="margin-top: 0px; "&gt;150&lt;/p&gt;&lt;/td&gt;&lt;td width="58"&gt;&lt;p style="margin-top: 0px; "&gt;$499.95*&lt;/p&gt;&lt;/td&gt;&lt;td width="47"&gt;&lt;p style="margin-top: 0px; "&gt;$225.99&lt;/p&gt;&lt;/td&gt;&lt;td width="51"&gt;&lt;p style="margin-top: 0px; "&gt;$1.51&lt;/p&gt;&lt;/td&gt;&lt;td width="63"&gt;&lt;p style="margin-top: 0px; "&gt;55%&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8297646" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/vo3oQWKTr6w" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure/default.aspx">Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure+Storage/default.aspx">Azure Storage</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/SQL+Azure/default.aspx">SQL Azure</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/02/16/microsoft-reduces-prices-on-sql-azure-cloud-storage.aspx</feedburner:origLink></item><item><title>Tips and Important Steps for Migrating Apps to Windows Azure</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/ZjYfYB_y3OQ/tips-and-important-steps-for-migrating-apps-to-windows-azure.aspx</link><pubDate>Sun, 29 Jan 2012 11:45:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8271363</guid><dc:creator>shiju</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8271363</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8271363</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2012/01/29/tips-and-important-steps-for-migrating-apps-to-windows-azure.aspx#comments</comments><description>&lt;p class="Default" style=""&gt;&amp;nbsp;&lt;span style="font-size: 11pt;"&gt;The
following are the few important steps and tips for migrating ASP.NET
apps to Windows Azure.&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Convert the ASP.NET application into a Web Role project.&lt;/li&gt;&lt;li&gt;Verify that the application is running correctly in the development environment.&lt;/li&gt;&lt;li&gt;Make sure that your application is 64-bit compatible since Window azure is a 64-bit environment.&lt;/li&gt;&lt;li&gt;Since Window Azure Web Roles runs on IIS7 Integrated mode, make sure that your web application does not have any issues with running on IIS 7 Integrated mode.&lt;/li&gt;&lt;li&gt;If your web app is using Session, Membership, Roles and Profile data, you have to find a way to make the state information is working with Windows Azure environment. You can use ASP.NET Universal Providers for handling Session, Membership, Roles and Profile which will be working with Sql Azure. The Windows Azure Caching Service is also providing a provider for ASP.NET Session state which will be faster than working with Sql Azure, but will be bit expensive than using Sql Azure.&lt;/li&gt;&lt;li&gt;If you are using ASP.NET caching, it would be recommended to use The Windows Azure Caching Service. The Windows Azure Caching Service is the better way to use Caching in Windows Azure.&lt;/li&gt;&lt;li&gt;Upload and save files to BLOB storage, if your web application is dealing with documents, media files, etc.&lt;/li&gt;&lt;li&gt;If your application is using any Windows services or using any background processing, migrate these services to Worker Roles. &lt;/li&gt;&lt;li&gt;Put messages to Windows Azure storage Queue or Service Bus Queue if you want to communicate between Web Role and Worker Role.&lt;/li&gt;&lt;li&gt;If you want to make federated claims-based authentication and single sign-on, you can use Windows Azure Access Control Service (ACS) that enables federated authentication. It will work with external identity providers such as Windows Live, Google, Facebook, and Open ID and you can also able to define service identities in ACS that lets you to authenticate without using an external identity provider.&lt;/li&gt;&lt;li&gt;Use startup tasks if you want to perform operations and install components before your Azure Role starts on Virtual Server. You can add startup tasks by editing the ServiceDefinition.csdef file. &lt;/li&gt;&lt;li&gt;Consider moving out some configuration settings in web.config files to ServiceConfiguration.cscfg so that you do not require redeployment after every change in configuration. Data in the ServiceConfiguration.cscfg file can be edited at runtime.&lt;/li&gt;&lt;li&gt;The Windows Azure environment does not provide a SMTP relay or mail relay service. So if your application is using e-mail services, it would be recommended to use a third party service (like SendGrid or AuthSMTP) to send email from inside Windows Azure.&lt;/li&gt;&lt;li&gt;If you are using Sql Azure, use a SQL Server 2008 R2 client so that you can easily migrate database schema and data into Sql Azure. And you can connect the Sql Azure from the SQL Server 2008 R2 client. &lt;/li&gt;&lt;/ol&gt;&lt;p class="Default" style=""&gt;&lt;br&gt;&amp;nbsp; &lt;br&gt;&lt;/p&gt;&lt;br&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8271363" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/ZjYfYB_y3OQ" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure/default.aspx">Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure+Storage/default.aspx">Azure Storage</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2012/01/29/tips-and-important-steps-for-migrating-apps-to-windows-azure.aspx</feedburner:origLink></item><item><title>Building a Windows Azure App using Azure Queue, Azure Table and ASP.NET MVC Web Role</title><link>http://feedproxy.google.com/~r/ShijuVBlog/~3/tp2vtSdWz9Y/building-a-windows-azure-app-using-azure-queue-azure-table-and-asp-net-mvc-web-role.aspx</link><pubDate>Thu, 01 Dec 2011 18:20:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8084325</guid><dc:creator>shiju</dc:creator><slash:comments>12</slash:comments><wfw:commentRss>http://weblogs.asp.net/shijuvarghese/rsscomments.aspx?PostID=8084325</wfw:commentRss><wfw:comment>http://weblogs.asp.net/shijuvarghese/commentapi.aspx?PostID=8084325</wfw:comment><comments>http://weblogs.asp.net/shijuvarghese/archive/2011/12/01/building-a-windows-azure-app-using-azure-queue-azure-table-and-asp-net-mvc-web-role.aspx#comments</comments><description>&lt;p&gt;In this post, I will demonstrate a Windows Azure app using Azure Queue, Azure Table and a ASP.NET MVC 4 Web Role application. This post is explaining few initial steps for building a demo Azure app where asynchronous commands (write operations that changes the data) put into Azure Queue and an Azure Work Role will persist the data into Azure Table from Queue messages for the read operations. The source code is available from &lt;a href="http://azurehack.codeplex.com/" mce_href="http://azurehack.codeplex.com/" target="_blank"&gt;http://azurehack.codeplex.com/&lt;/a&gt; .The demo application will modify and add more functionality on later.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Windows Azure Storage Services&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br&gt;The Windows Azure storage services provide the following services that are secure, scalable and easy to access that remain persistent and durable storage in the cloud.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Binary Large Object (BLOB)&lt;/b&gt; – BLOB service is the file system in the cloud which provide storage for large pieces of data, such as images, video, documents etc. BLOB is the simplest way to store text or binary data on Windows Azure. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Tables&lt;/b&gt; – Windows Azure Table Storage Service provides queryable structured storage.Table Storage service is very similar to NoSQL databases that lets you to massively scalable your apps. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Queues&lt;/b&gt; – Queue service provides reliable storage and delivery of messages and can be use for messaging between Web and Worker role instances.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Drives&lt;/b&gt; – Windows Azure Drive provides durable NTFS volumes for Windows Azure applications.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Demo Windows Azure App&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;In our demo app, all database write commands will be perform in an asynchronous way and these command messages will send&amp;nbsp; to Azure Queue.&amp;nbsp; A worker role will retrieve the Queue messages and will persist the data into Azure Table. The web role app is built with ASP.NET MVC 4. In this simple demo app, we are creating Customer entity data and these data will list&amp;nbsp; in a AS.NET MVC view page from a Azure Table. The request for creating a new Customer data will write a message to Azure Queue. The below class is representing the write command for creating new Customer&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; NewCustomerCommand : AzureQueueMessage&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; FirstName { get; set; }&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; LastName { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Address { get; set; }&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Phone { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Email { get; set; }&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;







.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;The new NewCustomerCommand is inherited from a&amp;nbsp; class AzureQueueMessage. The AzureQueueMessage class is the base class for the Azure Queue messages.The AzureQueueMessage class is shown below&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;abstract&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; AzureQueueMessage&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Id { get; set; }&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; PopReceipt { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; DequeueCount { get; set; }&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; DateTime? InsertionTime { get;  set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; DateTime? ExpirationTime { get; set; }&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;






.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;We are using strongly typed Azure Queue message. The below code block shows the contract type for our strongly type Azure Queue &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; IAzureQueue&amp;lt;T&amp;gt; &lt;span class="kwrd"&gt;where&lt;/span&gt; T : AzureQueueMessage&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; EnsureExist();&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; Clear();&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; AddMessage(T message);&lt;/pre&gt;

  &lt;pre&gt;    T GetMessage();&lt;/pre&gt;

  &lt;pre class="alt"&gt;    T GetMessage(TimeSpan timeout);&lt;/pre&gt;

  &lt;pre&gt;    IEnumerable&amp;lt;T&amp;gt; GetMessages(&lt;span class="kwrd"&gt;int&lt;/span&gt; maxMessagesToReturn);&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; DeleteMessage(T message);&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; DeleteMessage(CloudQueueMessage message);&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; DeleteQueue();&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;int&lt;/span&gt; ApproximateMessageCount { get; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;






.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Creating Queue messages from ASP.NET MVC Controller&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The below code block in the ASP.NET MVC action method will create the strongly typed queue message with type NewCustomerCommand. The write command NewCustomerCommand&amp;nbsp; is representing the operation for&amp;nbsp; creating a new Customer entity.&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;CloudStorageAccount account;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; CustomerController()&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;    account = CloudStorageAccount.&lt;/pre&gt;

  &lt;pre class="alt"&gt;         FromConfigurationSetting(&lt;span class="str"&gt;"DataConnectionString"&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;[HttpPost]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult Create(CustomerFormModel formModel)&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (ModelState.IsValid)&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;    AzureQueue&amp;lt;NewCustomerCommand&amp;gt; queue = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;                        AzureQueue&amp;lt;NewCustomerCommand&amp;gt;(account);&lt;/pre&gt;

  &lt;pre&gt;    queue.AddMessage(&lt;span class="kwrd"&gt;new&lt;/span&gt; NewCustomerCommand&lt;/pre&gt;

  &lt;pre class="alt"&gt;    {&lt;/pre&gt;

  &lt;pre&gt;        FirstName = formModel.FirstName,&lt;/pre&gt;

  &lt;pre class="alt"&gt;        LastName = formModel.LastName,&lt;/pre&gt;

  &lt;pre&gt;        Address = formModel.Address,&lt;/pre&gt;

  &lt;pre class="alt"&gt;        Phone = formModel.Phone,&lt;/pre&gt;

  &lt;pre&gt;        Email = formModel.Email&lt;/pre&gt;

  &lt;pre class="alt"&gt;    });              &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;return&lt;/span&gt; RedirectToAction(&lt;span class="str"&gt;"Index"&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;

  &lt;pre&gt; &lt;span class="kwrd"&gt;return&lt;/span&gt; View(formModel);&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;





.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;The class AzureQueue is a strongly typed Azure Queue. We are adding a message to the Queue with the information of&amp;nbsp; NewCustomerCommand. A worker role will look on the Queue message and will perform the operations for our command.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Processing Queue messages in Worker Role&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The Worker Role is similar to a windows service and mainly using for background processing. In our application, we are using the Worker Role for processing the Queue message send from Web Role application. The Azure Queue is a great way to communicate between Web Role and Worker Role.&lt;/p&gt;

&lt;p&gt;In the following code block in Worker Role, we are creating a strongly typed Queue with NewCustomerCommand and getting the unprocessed Queue messages from the Queue. After that, the data of the each Queue message is using for creating a Customer entity and will persist this data into Azure Table. The Table storage can be use for read operations of our application. We are deleting the Queue message after persisting the Customer entity into Azure Table.&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;var account = CloudStorageAccount.&lt;/pre&gt;

  &lt;pre&gt;FromConfigurationSetting(&lt;span class="str"&gt;"DataConnectionString"&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;AzureQueue&amp;lt;NewCustomerCommand&amp;gt; queue = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;   AzureQueue&amp;lt;NewCustomerCommand&amp;gt;(account);&lt;/pre&gt;

  &lt;pre class="alt"&gt;queue.EnsureExist();            &lt;/pre&gt;

  &lt;pre&gt;            &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;while&lt;/span&gt; (&lt;span class="kwrd"&gt;true&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;try&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt; var message = queue.GetMessage();                    &lt;/pre&gt;

  &lt;pre&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (message != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre class="alt"&gt;  {&lt;/pre&gt;

  &lt;pre&gt;        &lt;/pre&gt;

  &lt;div class="csharpcode"&gt;
    &lt;pre class="alt"&gt;AzureTable&amp;lt;Customer&amp;gt; table = &lt;span class="kwrd"&gt;new&lt;/span&gt; AzureTable&amp;lt;Customer&amp;gt;(account);&lt;/pre&gt;

    &lt;pre&gt;    var guiid= Guid.NewGuid().ToString();&lt;/pre&gt;

    &lt;pre class="alt"&gt;    table.AddEntity( &lt;span class="kwrd"&gt;new&lt;/span&gt; Customer&lt;/pre&gt;

    &lt;pre&gt;    {&lt;/pre&gt;

    &lt;pre class="alt"&gt;        Id = Guid.NewGuid().ToString(),&lt;/pre&gt;

    &lt;pre&gt;        PartitionKey = guiid,&lt;/pre&gt;

    &lt;pre class="alt"&gt;        RowKey = message.FirstName,&lt;/pre&gt;

    &lt;pre&gt;        FirstName = message.FirstName,&lt;/pre&gt;

    &lt;pre class="alt"&gt;        LastName=message.LastName,&lt;/pre&gt;

    &lt;pre&gt;        Address=message.Address,&lt;/pre&gt;

    &lt;pre class="alt"&gt;        Phone=message.Phone,&lt;/pre&gt;

    &lt;pre&gt;        Email=message.Email &lt;/pre&gt;

    &lt;pre class="alt"&gt;    });&lt;/pre&gt;

    &lt;pre&gt;    queue.DeleteMessage(message);&lt;/pre&gt;
  &lt;/div&gt;
  &lt;style type="text/css"&gt;


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;catch&lt;/span&gt; { }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    Thread.Sleep(5000);&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;We are using a Azure Table entity Customer for persisting the Customer data. The Customer Table entity is shown below&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Customer : TableServiceEntity&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Id { get; set; }&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; FirstName { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; LastName { get; set; }&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Address { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Phone { get; set; }&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Email { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The Customer entity is inherited from TableServiceEntity for making the Customer entity as a Azure Table. The TableServiceEntity provides properties PartionKey, RowKey and Timestamp. The server manages the value of Timestamp, which cannot be modified. We need to update the values of PartitionKey and RowKey.The partition key is a unique identifier for the partition within a given table, specified by the PartitionKey property. The partition key forms the first part of an entity's primary key. The second part of the primary key is the row key, specified by the RowKey property. The row key is a unique identifier for an entity within a given partition. Together the PartitionKey and RowKey uniquely identify every entity within a table. &lt;/p&gt;

&lt;p&gt;The AzureTable class is using for the all CRUD operations for Azure Table. The below code block shown the contract type of AzureTable class.&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; IAzureTable&amp;lt;TEntity&amp;gt; &lt;span class="kwrd"&gt;where&lt;/span&gt; TEntity : TableServiceEntity&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    IQueryable&amp;lt;TEntity&amp;gt; Query { get; }&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;bool&lt;/span&gt; CreateIfNotExist();&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;bool&lt;/span&gt; DeleteIfExist();&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; AddEntity(TEntity obj);&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; AddEntity(IEnumerable&amp;lt;TEntity&amp;gt; objs);&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; AddOrUpdateEntity(TEntity obj);&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; AddOrUpdateEntity(IEnumerable&amp;lt;TEntity&amp;gt; objs);&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; DeleteEntity(TEntity obj);&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; DeleteEntity(IEnumerable&amp;lt;TEntity&amp;gt; objs);&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;b&gt;Reading the data in ASP.NET MVC App &lt;/b&gt;&lt;/p&gt;

&lt;p&gt;We are showing the Customer data from Azure table and periodically refresh the data using Ajax. The following code in the ASP.NET MVC action method querying the data from Azure Table Customer.&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult Index()&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;  AzureTable&amp;lt;Customer&amp;gt; table = &lt;span class="kwrd"&gt;new&lt;/span&gt; AzureTable&amp;lt;Customer&amp;gt;(account);&lt;/pre&gt;

  &lt;pre&gt;  var customers = table.Query;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;if&lt;/span&gt; (Request.IsAjaxRequest())&lt;/pre&gt;

  &lt;pre&gt;  {&lt;/pre&gt;

  &lt;pre class="alt"&gt;     &lt;span class="kwrd"&gt;return&lt;/span&gt; PartialView(&lt;span class="str"&gt;"_List"&lt;/span&gt;, customers);&lt;/pre&gt;

  &lt;pre&gt;  }&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;span class="kwrd"&gt;return&lt;/span&gt; View(customers);&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Since our write command is working in an asynchronous way, we are refreshing the 
view page periodically using Ajax&amp;nbsp;for latest data&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;@model IEnumerable&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;AzureHacks.Domain.Models.Customer&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;@{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    ViewBag.Title = "Index";&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;h2&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Index&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;h2&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    @Html.ActionLink("Create New", "Create")&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="CustomerList"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;@Html.Partial("_List", Model)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="text/javascript"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;$(&lt;span class="kwrd"&gt;function&lt;/span&gt; () {&lt;/pre&gt;

  &lt;pre&gt;setInterval(&lt;span class="kwrd"&gt;function&lt;/span&gt; () {&lt;/pre&gt;

  &lt;pre class="alt"&gt; $.get(&lt;span class="str"&gt;'@Url.Action("Index")'&lt;/span&gt;, {}, &lt;span class="kwrd"&gt;function&lt;/span&gt; (view) {&lt;/pre&gt;

  &lt;pre&gt;    $(&lt;span class="str"&gt;"#CustomerList"&lt;/span&gt;).html(view);&lt;/pre&gt;

  &lt;pre class="alt"&gt;  })&lt;/pre&gt;

  &lt;pre&gt; },5000);&lt;/pre&gt;

  &lt;pre class="alt"&gt;});&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;   &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;b&gt;Source Code&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The source code can be download from &lt;a href="http://azurehack.codeplex.com/" mce_href="http://azurehack.codeplex.com/" target="_blank"&gt;http://azurehack.codeplex.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;This post is an initial step for building a demo app on the Windows Azure. We have discussed Azure storage services Queue and Table and explored the Worker Role for processing Queue messages. Azure Queue is a great way to communicate between Web Role and Worker Role. And the Azure Table is providing a great way to store massively scalable structured data that is available for querying the data. We are are performing our commands in an asynchronous way&amp;nbsp; and Azure Table is using for our read operations. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8084325" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/ShijuVBlog/~4/tp2vtSdWz9Y" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/ASP.NET+MVC+3/default.aspx">ASP.NET MVC 3</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/CQRS/default.aspx">CQRS</category><category domain="http://weblogs.asp.net/shijuvarghese/archive/tags/Azure+Storage/default.aspx">Azure Storage</category><feedburner:origLink>http://weblogs.asp.net/shijuvarghese/archive/2011/12/01/building-a-windows-azure-app-using-azure-queue-azure-table-and-asp-net-mvc-web-role.aspx</feedburner:origLink></item></channel></rss>

