Microsoft Azure: Enterprise Application Development Straight talking advice on how to design and build enterprise applications for the cloud Richard J. Dudley Nathan A. Duchene professional expertise distilled P U B L I S H I N G BIRMINGHAM - MUMBAI Microsoft Azure: Enterprise Application Development Copyright © 2010 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: December 2010 Production Reference: 1231110 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-849680-98-1 www.packtpub.com Cover Image by Vinayak Chittar ([email protected]) Credits Authors Editorial Team Leader Richard J. Dudley Gagandeep Singh Nathan A. Duchene Project Team Leader Lata Basantani Reviewers Ruslan Konviser Anton Staykov Project Coordinator Rebecca Sawant Acquisition Editor James Lumsden Proofreader Ting Baker Development Editor Dhwani Devater Graphics Geetanjali Sawant Technical Editor Gaurav Datar Production Coordinator Shantanu Zagade Indexer Rekha Nair Cover Work Shantanu Zagade About the Authors Richard J. Dudley has experience in the field of computers, going all way back to PC-DOS 1.1 (of which the original box still sits in a closet), with 128K and dual floppies. He began programming in GW-BASIC, and has used nearly every BASIC variant along the way. He was very active in the Louisville BBS community in the 1980s. Richard holds a BS in Environmental Science from Allegheny College, and an MS in Biological Sciences from The University of Alabama. He developed his programming skills as a way to record and analyze his data, and later collaborate with other labs as the World Wide Web slowly came into being. Eventually, the dot com boom was too tempting, and Rich left science to be become a full-time developer. Rich spent 10 years as an Enterprise Developer, building and supporting everything from consumer websites to several mission-critical systems integrations, to Crystal-and SSRS-based BI tools, to a number of internal line-of-business applications. Rich is now a Technology Evangelist for ComponentOne, where his job is to support the user community by working with all the latest Microsoft technologies. Rich's past employers include The University of Alabama-Birmingham (Research Assistant V), The University of Pittsburgh (Research Specialist II), Spang & Co. (e-Commerce Developer), and Armada Supply Chain Solutions (Senior Application Developer). Acknowledgement You always see an author thank his or her family, and until you write a book, you can't really understand why. Writing a book is time consuming—you spend a lot of time looking out of a window watching the seasons pass by, wishing you were kayaking on the nearby lake, or going for a bike ride, or anything other than being inside staring at a glowing rectangle hoping the words start flowing soon. We've made almost one complete turn around the sun since we started this book, and it is the culmination of a great deal of work. So, at the risk of sounding clichéd, I have to thank my wife Kathy, and daughter Anna Claire, who can now have her daddy back. The impetus to write a technical book doesn't come from money—there's a small advance, and if you're really lucky, maybe some royalties. Fame? Not really—if you're popular, maybe a dozen people will tweet about you. The urge to write a book comes from something more fundamental, something our parents instilled in us and we try and instill in our children—sharing. Share your experiences, share what you know, as doing so builds a stronger community. I hope you find what we've done to be useful. Nathan A. Duchene has been developing in the .NET Framework since 2005, starting with ASP.NET 2.0. He found a need for a website with the features available in ASP.NET, and with some guidance from Richard J. Dudley, quickly developed and published his web application to the world. After experiencing the ease and flexibility offered by .NET to developers, he decided to learn more features, best practices, and tricks to enhance his web application, build new web applications, write and maintain some console applications, and much more. In 2008, Nathan and Richard developed and entered a web application into a coding contest, which was voted by the community as the second best of all submissions, losing only by a few votes. Winning an MSDN Premium subscription, it allowed Nathan to play with a number of systems and tools, strengthening his knowledge in the development world. Nathan, along with Richard, was part of a group that gave a presentation on Silverlight 2 in the Windows Azure cloud in 2009. Both technologies were in beta or pre-beta phases, which caused unexpected issues. Even though the application would not work, the talk was a great success in explaining Windows Azure and Silverlight 2 before they were released to the world. Nathan is currently an Application Developer for a supply chain solutions company based in Pittsburgh, PA. Along with some .NET development, he also develops and administers solutions using Microsoft SQL Server 2000/2005/2008, Microsoft Biztalk Server 2009, and Microsoft Office SharePoint Server 2007. This is Nathan's first book and has been a tremendous experience from front to back. After being given the opportunity to pass on some knowledge back to the community, he hopes to have the opportunity in the future to write more books for the community. After observing how quickly technology changes, he feels it's important to release up-to-date information for others to make use of. While Nathan and Richard had to re-write numerous chapters along the way to include new features or changes to existing features, the experience was amazing. Acknowledgement I'd like to thank my family and friends for all the support throughout the book process. Not only did they support me, but the encouragement helped me through some rough times when I thought it to be a difficult task to be physically able to write the book with everything else going on at the time. Without my friends and family, I couldn't have made it through this journey. Most importantly, I'd also like to thank my co-author, Richard Dudley. He has been a colleague, a friend, and a mentor over the last eight years. He's shown me opportunities that no one else has and I'm really happy to have him around as a partner in everything we've done. Richard's enthusiasm to help me flourish personally and professionally has had the most meaning in my life recently, and I look forward to working side-by-side with him over the next decades. About the Reviewer Anton Staykov has over nine years of solid experience in developing dynamic software solutions (corporate web portals, rich media sites, e-commerce sites, internal software solutions covering specific business needs), using the latest technologies, including Microsoft .NET, MS SQL Server, PHP, MySQL. Currently he is Technical Evangelist for a world leader in the field of User Interface Development Tools and User Experience services. He is User Group Lead for Windows Azure User Group Bulgaria. Anton is an Engineer in Telecommunications and Master of Science in Internet Software Technologies. You can visit his blog at: http://blogs.staykov.net/. Table of Contents Preface 1 Chapter 1: Introduction to Cloud Computing 7 What is an enterprise application? 7 What is cloud computing? 8 Some benefits of cloud computing 9 Some downsides of cloud computing 10 Cloud computing infrastructure 11 Cloudy skies ahead 12 Is cloud computing "enterprisey" enough? 13 Summary 14 Chapter 2: The Nickel Tour of Azure 15 Explaining Azure to the managers 15 Windows Azure 17 Compute service 17 Storage service 18 Blob Storage 18 Table Storage 19 Queue Storage 19 Azure Fabric Agent and Controller 20 SQL Azure 20 Windows Azure platform: AppFabric 21 Codename Dallas 22 Development Fabric 22 Considerations for the ASP.NET developer 22 How are Azure costs calculated? 23 Calculating Windows Azure pricing 23