Niraj Bhatt – Architect's Blog

Ruminations on .NET, Architecture & Design

Category Archives: Windows Azure

Book Review: Microsoft Windows Azure Development Cookbook

Apparently, this is my first public book review. A month back when PACKT Publishing asked me to do a review of this book I was delighted for couple of reasons. Firstly, I would get my hands on a book I so much wanted to read and secondly review the work of the maestro – Neil Mackenzie. If you don’t know Neil most probably you haven’t done a serious Windows Azure project 🙂 . Neil is the most active person on Windows Azure MSDN Forum, maintains a comprehensive blog on Windows Azure (at times I have felt that the depth of his blog entries surpasses that of MSDN documentation) and a Windows Azure MVP we all are proud of.

Highlight of the book for me are the exercises (referred as recipes), which are to the point, with concise code snippets, cutting the unnecessary verbose. Book’s first chapter starts with a very important yet very less discussed topic – authenticating with Windows Azure Platform. Chapter covers authentication scenarios pertaining to Azure Storage, Service Management, and AppFabric (caching) covering subtle topic of storage key rotation. Second chapter gives a thorough coverage of Blob storage including Leasing and leveraging Azure CDN. Third and fourth chapter dive into Tables and Queues again discussing key topics Pagination and polling back off (we recently helped a client cut on its transactional cost using similar approach). Fifth chapter which happens to be longest chapter of the book is really packed. You would be amazed at how much information is covered in these hundred pages. Chapter covers everything about hosting on Azure – multiple websites in a single role, HTTPS support, VM Role, Azure Connect and MarketPlace DataMarket among others. Chapter sixth and seventh contains vital topics of diagnostics (your key to success on Azure Platform) and service management APIs. It’s interesting to read the PowerShell coverage of these chapters. Finally book ends with couple of chapters around SQL Azure and Azure AppFabric. I was impressed with Neil’s knowledge around SQL Server DB and detailing of DMVs (dynamic management views).

Coming to the cons of the book, depending on your experience you might feel that book could have been better organized. May be an introduction chapter or an appendix at the end providing a 360 degree overview of Windows Azure could have been helpful. Also, while recipes are compact; snippets and corresponding explanations are done separately which at times is tedious to shuffle between. Lack of screenshots might be a concern to few readers. Also few topics like Access Control Service, WCF services, etc. have lesser focus (in case those are your prime use cases).

To sum up, writing Azure book is tough, especially with the rapid release cycles and features being churned regularly. Considering that, I would commend author for his work and would strongly recommend this book to accelerate your knowledge on Windows Azure. Three hundred plus pages can easily transform you into a PRO, helping you create more effective Windows Azure solutions.

Happy Reading 🙂 !!!

(P.S. You can download a sample chapter of the book from here).

Your Deals, Your Way – Leveraging Windows Azure for Facebook Applications

In this blog post I will describe how you can use the demo version of Your Deals, Your Way (YDYW). YDYW is a web application hosted on Windows Azure and integrates with Facebook. You can access the application at – http://apps.facebook.com/yourdealsyourway. Below is a quick walkthrough of major workflows of the application (subscribing a deal and posting a deal) and a quick discussion on preventing your Facebook account from being spammed. Let;s get started:

a) SUBSCRIBING TO DEALS
As a first step you need login with your Facebook account and grant it the required permissions.

Now you will be moved to ‘Pick Your Deals!!!’ Page where you can pick deals you wish for

Once you pick up a deal you see it populated in your wishful deals.

Now whenever these deals would be available YDYW would leave a message on your Facebook wall, helping your friends to know about them and help you connect with others in case a bulk order discount is offered by vendor.

b) POSTING DEALS
For the demo version posting a deal is open to anyone. One needs to browse the application page – http://yourdealsyourway.cloudapp.net. Login with account for which you want to post the deal

Once logged into the application, you can see the subscribers’ graph allowing the account owner to see how many people are subscribed for his products, at what discounts and identify what is the viral reach of total subscribers for each product.

Deals can be placed then for a given product, given discount till a given date and once placed they too will be available inside ‘Deals already placed’ section

Whenever deal is placed it would notify all the subscribes in step (a) by leaving a message on their wall as below

c) PREVENT FB ACCOUNT FROM SPAM
As posting deals is open to general public at times you might find lot more posts on your walls. They way to turn of them is either deleting that post or unsubscribing to all the deals or remove access to the application. These are described below.

1) Removing a post on your wall is simple – just remove it by clicking close button

2) Unsubscribing to deals too is quite easy just delete them. Application notifies you only when you are subscribed to a deal, removing these deals would ensure that you receive any unwanted messages

3) Finally you can remove the access to ‘Your Deals, Your Way’, a route which I hope you won’t take . Do the same you need to go your account privacy settings as shown below

Browse to Apps and Websites

And finally remove the ‘Your Deals, Your Way’

That’s it!!! Hope you had a good time visiting YDYW. Thanks for your time in testing out the alpha version and I look forward to your feedback 🙂 .

Installations for Setting up Windows Azure

Recently I had to format my machine and then had to go through the pain of setting it up again. I always have Windows Azure bits running on my machine. Hence, I thought of sharing related links which I have kept handy, hoping in case you have fresh machine to start with it would be helpful to you as well. Quick note to check the date of this blog post as the steps outlined could have been outdated (though I would try my best to revise the post as much as possible). Below are tools / SDKs one would ideally install after installing VS.NET 2010 (and SQL Server Express).

a) Windows Azure SDK and tools for Visual Studio – The latest release of Windows Azure SDK is 1.4. If you want to install SDK and corresponding tooling for Visual Studio you can use the bundle – ‘VSCloudService.exe’. I would encourage you to follow the steps outlined in the Instructions section of the download page.

b) Windows Identity Foundation Runtime – One would need this runtime for working with Windows Azure AppFabric components like Service Bus and Access Control Service

c) Windows Identity Foundation SDK – Apart from providing samples this WIF SDK provides tooling for Visual Studio making the WIF work experience a breeze

d) Windows Azure AppFabric SDK V 1.0 – The necessary SDK to work with Windows Azure Appfabric

e) Windows Azure AppFabric SDK V 2.0 – This update provides access to latest components of Windows Azure AppFabric like Caching Service and few enhancements to the existing components

Hope this helps!!!

Tech Ed 2011 Memorabilia

I thought of jotting down my top 5 memories of TechEd 2011 like I did for 2009 and 2010.

1) Co-presenting with Sachin: Sachin is undoubtedly one of the best presenters in Microsoft India. Not many know but he holds 14 patents. His dedication to his work is really admirable, in fact the day before we were walking through the demos till pass midnight. Hope we get an opportunity to co-present again 🙂

2) Guts – Live Azure Deployment: I have seen many Azure demos and most of them run on premise with emulators, guaranteeing the same would run in cloud which in fact in never does. Few other demos are already deployed on cloud which takes away the simplicity of Windows Azure. So we thought of creating a WIF enabled application from scratch and deploying it LIVE to Azure. Challenge of course was that this would take 7 – 8 minutes and we had to keep the momentum flowing during that timeframe. And most important – there is no second chance, in case deployment fails it would ruin the show. In the end it was all guts, we did live deployment and it was perfect 10.

3) MCP on Azure: Like 2009 this time around too TechEd offered free certifications and the one on offer was 70-583. I took a chance and was the first to clear this certification at the TechEd. Interestingly I have passed only 2 Microsoft Exams till date, and both happen to be @ TechEd.

4) A photo with Sanjay Vyas: This was definitely the moment. Sanjay is synonymous with TechEd and one of the finest presenters of our country. His humor, passion, wit and knowledge have no match. Let me hope someday I get lucky to co-present with him.

5) TechEd Memento: A Hatrick of mementos. It definitely means a lot to me 🙂 . Thanks to one and all that made this possible. As usual, it’s GIDS time now.

Hosting / Deploying WIF enabled application on Windows Azure – Tech Ed India 2011 Live

Hello Folks, hope you had a great time attending the session as much we had presenting it. Thanks for your applause 🙂 . Below are the simple steps to replicate the glitch free demo I showcased. So just go ahead and gets your hands on WIF and Windows Azure.
System setup would need VS.NET 2010, Windows Azure SDK 1.4, WIF Runtime, WIF SDK, Windows Azure Account and a AppFabric Labs account. To start with create a new ASP.NET MVC 2 web application.

Just head to Web.config and change the authentication mode to Windows

Run the application and your page should show your identity something like below (you can change the Site.Master and HomeController.cs)

Next we are all set to outsource the authentication to STS. I have used SelfSTS here but you might as well use a ADFS V2. Below are the snapshots of the claims that are part of my SelfSTS and SelfSTS in a running mode


After starting SelfSTS head back to your VS.NET solution and right click your project and select ‘Add STS Reference’ (ensure WIF SDK is installed to get this in your context menu). Add your localhost application URI and copy the Federation URL highlighted earlier (select default for other pages in Wizard and ignore warning for HTTS considering the fact this is a demo application)


Make the below changes to your web.config (latter is required only if you plan to use SecurityTokenVisualizerControl)


You can add authorization code as below to display ‘Welcome Architect’ only if the group claim says you are an architect


It’s time to leverage Access Control Service now as a Federation provider allowing us to connect with multiple identity providers without modifying single line of code. Go to the AppFabric labs portal and sign in with your live ID. Create your service namespace and click on manage access control service

Add an Identity provider which refers to your Local STS, and then a replying party application. Generate Rule Groups and copy the Application Integration URL (I am skipping screen shots expect the one for Identity Provider as they very obvious). Take the Application integration FedMedata URL and repeat the process we did earlier with Self STS but for Application URI you need to specify your Cloud Application URL. Ensure you set Copy Local to True for System.IdentityModel and System.Web.MVC DLLs. That’s it!!! Go ahead and deply your application on cloud and sign in to access your cloud application using WIF

Here’s the link to hosted version of the application. You must have local STS running to test it. Enjoy 🙂

Microsoft Certified Career Conference Promotion Code

Folks, I am super excited to present at Microsoft Certified Career Conference on 18th February, 2011 (IST +5:30). To me it’s a rare and wonderful conference that focuses on overall career growth. Though technology happens to be an important aspect of our software industry, one can rarely succeed driving on it alone – irrespective of his / her designation. To help with the same conference has a wide variety of sessions including Communication, Listening skills, Certifications, Resume writing, and technology among others. My talk though technical in nature hopefully would be quite edible and appealing. It intends to unleash the horror behind login screens and especially the identity stores attached to them. It walks through the series of challenges faced by developers, IT Pros and Businesses showing how we can overcome them. Finally I have some good news. If you plan to register for the conference you can use the Promo code – CCDX5CH6MS and attend the conference for USD 10 per entrance ticket (80% discount on the regular fee). Not sure if one could have asked for more 🙂 .

India’s First Public Windows Azure Boot Camp

Hello Folks!!! I am excited to share with you that we are conducting the first public Windows Azure Boot Camp in India, location being Bangalore. I would be the speaker for these two days event which would level 100 – 200 introduction on Windows Azure. Due to various constraints we have limited the entry to twenty-five participants. Thanks to you all, currently we have about 250 registrations for the event and we are almost done with selecting the final list of attendees. I wish I had added the column in the registration page wherein one can specify the reason why he or she should be given a preference over others. Though we definitely plan to have that for future events, for this event if you happen to read this blog entry and have a strong reason for attendance (current project on Azure / Passion for Azure / Helping at the event, etc.) do drop me mail. I will try to put across your case and do my best to include you (no guarantee though). Anyways, thanks to all who have registered and hopefully we have selected the best 🙂 . Keep learning, keep sharing!!!

How to Assess Web Applications for Migration to Windows Azure?

Your company’s top management has decided to leverage Cloud computing. They have zeroed on Windows Azure considering their existing investments in Microsoft stack, seamless developer experience, on-premise integration capabilities, competitive pricing, etc. You have been tasked to prepare a roadmap for migrating to Windows Azure. You are not quite sure where to start, what to do, which process to follow, how to come up with a strategy that would show bottom line benefits to top the management? If this is your story, I encourage you to read further.

Windows Azure Platform is an end-to-end development and deployment platform for building cloud services. But moving your on premise applications to Windows Azure isn’t a simple decision. Ideally, one would like to move an application that provides maximum ROI and poses minimum risks. Risks could be ensuring business continuity, data security, technology investments, etc. To get started, a good approach is to take the existing portfolio of web applications in your enterprise and prepare a dashboard. This can help assessing where you stand. Dashboard sample shown below captures not only on-premise applications but also hosted applications enabling you to do vis-à-vis with Cloud model.

Dashboard should also include packaged applications in addition to your home grown applications. It’s important to include package applications as there is quite a possibility that the vendor of the packaged application may have a cloud based offering too. Such an offering can be a quick win for your organization, and you immediately mitigate all risks apart from the once related to governance. Another value add is ROI calculations. Calculations could be quite accurate for these packaged applications and your vendor in most cases will provide you with all the necessary inputs. An example of this could be moving to Microsoft’s Business Productivity Online Suite (BPOS) which provides cloud based versions of Exchange, SharePoint, etc.

Coming to assessment of home grown web applications one needs to look for specific patterns to get maximum ROI. I strongly recommend to get started by using TCO calculator available on Windows Azure Portal. Though TCO numbers may vary a lot, what I like is – it provides a thought pattern. It helps you identify the key parameters you need to consider for your assessment. For instance it forces you to pick one of the 4 growth profiles for your web application

In order to justify your ROI it becomes imperative that you are able to map your web applications to one of these profiles. A Key motivation for this activity is to leverage Windows Azure’s “Scale on demand” capability. Depending on these traffic patterns additional server resources can be dynamically assigned to the web application. After the purpose is met these server resources can be dropped and with “Pay as you go” model, you pay only for the capacity you require. Although patterns above are self-explanatory let’s walk through them quickly. Time Bound refers to the short team compute requirements catering to launch of new products, marketing campaigns, etc. Steady growth is one of those applications in your enterprise which has a steady growing user base and your IT keeps bringing new hardware every few years. Predictable spikes attributes to known scenarios where you expect users to flock on your site. E.g. could be a sports season or a festival season. Unpredictable spikes refer to unforeseen scenarios like bad / good press, mergers, etc. It’s quite obvious to see the value add Windows Azure can bring in for such web applications.

Further compute resources aren’t the only ones that a web application requires. It could be storage resources too. I have come across quite a few web applications that store various kinds of data including images, videos, voice calls, etc. for analysis, processing and streaming. Storage requirements for such applications grow steadily and often become a challenge for in-house IT to keep pace with. Windows Azure provides an infinite sort of non-relational storage including Blob, Table, Drive and Queue, which can be ramped up almost instantly. In addition, Azure storage has redundancy, disaster recovery and backup in place with easy to use APIs for data access. Of course one has to factor in the bandwidth charges for every request made to access the media, but Azure’s Content Delivery Network (CDN) can come in handy. So many a times it’s storage that could be your real differentiator.

A final important piece to your assessment is the effort involved in migrating your web application to Windows Azure. Depending on the current architecture of your web application this could be a serious undertaking. Components like web sessions, diagnostics, relational DB, distributed cache, COM components, operational integration, third party softwares, security, etc. would need a migration plan, feasibility check and corresponding budget approvals. Security especially is a widely discussed topic. While migrating to cloud security normally needs to be applied at 2 levels – data at rest (disk) and data in motion (wire). Security implementation can be done using encryption and related techniques. Windows Azure platform also consists of AppFabric that can allow you to take your on-premise identity investments to the cloud using Access Control Service. In case there is some sensitive data that can be stored only on your premises you can use AppFabric’s Service Bus to tunnel back from Cloud.

To summarize one needs a step based approach in assessing which applications are the ideal ones to migrate to Windows Azure. You need to balance the tradeoffs and risks while ensuring your ROI is intact. Good luck with your assessments.

The dream that you wish will come true

It’s the Cinderella song that I am talking about. At last Windows Azure ISV days in New Delhi, it was a personal lifetime experience receiving the Cloud developer award from hands of Steve Ballmer. I have no words to express my heartfelt gratitude to everybody at Microsoft, Microsoft communities, colleagues, friends and family. Below are the few pictures from the event

I wish you the success with your dreams. Keep Rocking!!!

Your Feedback, My Passion – BLRCTD2010

Had a great time presenting at Community Tech Days. This was the first time I was doing opening session. Normally, I avoid doing it to get some buffer time, in case things go wrong. Nevertheless, it was an awesome experience. Thanks to the audience for making it so early on weekends. Hope the session was worth your time. You can find the presentation and demos here. Demos were largely from AppFabric SDK tweaked to convey a scenario. If you enjoyed the video I got the link from Vittorio’s Blog. Until next time, keep learning & sharing. Love you all 🙂 .