Building Real World Cloud Apps With Windows Azure

  • Published on
    20-Jan-2016

  • View
    131

  • Download
    0

Embed Size (px)

DESCRIPTION

Building Real World Cloud Apps With Windows Azure.pdf

Transcript

  • Building Real-World Cloud Apps with

    Windows Azure

    Tom Dykstra Rick Anderson Mike Wasson

    Summary: This e-book walks you through a patterns-based approach to building real-

    world cloud solutions. The patterns apply to the development process as well as to

    architecture and coding practices. The content is based on a presentation developed by

    Scott Guthrie and originally delivered at the Norwegian Developers Conference (NDC) in

    June of 2013. Many others updated and augmented the content while transitioning it

    from video to written form.

    Category: Guide

    Applies to: Windows Azure Web Sites, ASP.NET, Visual Studio, Visual Studio Online,

    Windows Azure Active Directory, Windows Azure SQL Database,

    Source: ASP.NET site (source content)

    E-book publication date: January, 2014

  • Copyright 2014 by Microsoft Corporation

    All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means

    without the written permission of the publisher.

    Microsoft and the trademarks listed at

    http://www.microsoft.com/about/legal/en/us/IntellectualProperty/Trademarks/EN-US.aspx are trademarks of the

    Microsoft group of companies. All other marks are property of their respective owners.

    The example companies, organizations, products, domain names, email addresses, logos, people, places, and events

    depicted herein are fictitious. No association with any real company, organization, product, domain name, email address,

    logo, person, place, or event is intended or should be inferred.

    This book expresses the authors views and opinions. The information contained in this book is provided without any

    express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors

    will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book.

  • Table of Contents

    Introduction .................................................................................................................................................. 7

    Intended Audience .................................................................................................................................... 8

    Cloud development patterns .................................................................................................................... 9

    The Fix it sample application .................................................................................................................. 10

    Windows Azure Web Sites ...................................................................................................................... 17

    Getting started ........................................................................................................................................ 19

    Summary ................................................................................................................................................. 33

    Resources ................................................................................................................................................ 33

    Automate Everything .................................................................................................................................. 34

    DevOps Workflow ................................................................................................................................... 34

    Windows Azure management scripts ..................................................................................................... 35

    Environment creation script ................................................................................................................... 35

    Deployment script ................................................................................................................................... 45

    Summary ................................................................................................................................................. 47

    Resources ................................................................................................................................................ 48

    Source Control ............................................................................................................................................ 49

    Treat automation scripts as source code ................................................................................................ 49

    Dont check in secrets ............................................................................................................................. 49

    Structure source branches to facilitate DevOps workflow ..................................................................... 50

    Add scripts to source control in Visual Studio ........................................................................................ 52

    Store sensitive data in Windows Azure .................................................................................................. 56

    Use Git in Visual Studio and Visual Studio Online ................................................................................... 59

    Summary ................................................................................................................................................. 67

    Resources ................................................................................................................................................ 68

    Continuous Integration and Continuous Delivery ...................................................................................... 69

    Continuous Integration and Continuous Delivery workflow .................................................................. 69

    How the cloud enables cost-effective CI and CD .................................................................................... 70

    Visual Studio Online ................................................................................................................................ 70

    Resources ................................................................................................................................................ 71

    Web Development Best Practices ............................................................................................................... 73

    Stateless web tier behind a smart load balancer .................................................................................... 73

  • Avoid session state.................................................................................................................................. 78

    Use a CDN to cache static file assets....................................................................................................... 78

    Use .NET 4.5s async support to avoid blocking calls .............................................................................. 78

    Summary ................................................................................................................................................. 81

    Resources ................................................................................................................................................ 81

    Single Sign-On ............................................................................................................................................. 83

    Introduction to WAAD ............................................................................................................................ 83

    Set up a WAAD tenant ............................................................................................................................ 86

    Create an ASP.NET app that uses WAAD for single sign-on ................................................................... 99

    Summary ............................................................................................................................................... 104

    Resources .............................................................................................................................................. 105

    Data Storage Options ................................................................................................................................ 106

    Data storage options on Windows Azure ............................................................................................. 106

    Hadoop and MapReduce ...................................................................................................................... 108

    Platform as a Service (PaaS) versus Infrastructure as a Service (IaaS) ................................................. 112

    Choosing a data storage option ............................................................................................................ 115

    Demo using SQL Database in Windows Azure ................................................................................... 117

    Entity Framework versus direct database access using ADO.NET ........................................................ 125

    SQL databases and the Entity Framework in the Fix It app .................................................................. 125

    Choosing SQL Database (PaaS) versus SQL Server in a VM (IaaS) in Windows Azure .......................... 127

    Summary ............................................................................................................................................... 130

    Resources .............................................................................................................................................. 130

    Data Partitioning Strategies ...................................................................................................................... 133

    The three Vs of data storage ................................................................................................................. 133

    Vertical partitioning .............................................................................................................................. 133

    Horizontal partitioning (sharding)......................................................................................................... 135

    Hybrid partitioning ................................................................................................................................ 136

    Partitioning a production application ................................................................................................... 136

    Summary ............................................................................................................................................... 136

    Resources .............................................................................................................................................. 137

    Unstructured Blob Storage ....................................................................................................................... 138

    What is Blob storage? ........................................................................................................................... 138

    Creating a Storage account ................................................................................................................... 138

  • Using Blob storage in the Fix It app ...................................................................................................... 140

    Summary ............................................................................................................................................... 146

    Resources .............................................................................................................................................. 147

    Design to Survive Failures ......................................................................................................................... 148

    Types of failures .................................................................................................................................... 148

    Failure scope ......................................................................................................................................... 148

    SLAs ....................................................................................................................................................... 149

    Summary ............................................................................................................................................... 152

    Resources .............................................................................................................................................. 153

    Monitoring and Telemetry ........................................................................................................................ 154

    Buy or rent a telemetry solution ........................................................................................................... 154

    Log for insight ....................................................................................................................................... 172

    Logging in the Fix It app ........................................................................................................................ 175

    Dependency Injection in the Fix It app ................................................................................................. 179

    Built-in logging support in Windows Azure .......................................................................................... 180

    Summary ............................................................................................................................................... 184

    Resources .............................................................................................................................................. 184

    Transient Fault Handling ........................................................................................................................... 186

    Causes of transient failures ................................................................................................................... 186

    Use smart retry/back-off logic to mitigate the effect of transient failures .......................................... 186

    Circuit breakers ..................................................................................................................................... 187

    Summary ............................................................................................................................................... 189

    Resources .............................................................................................................................................. 189

    Distributed Caching .................................................................................................................

Recommended

View more >