Microsoft Silverlight 5 and Windows Azure Enterprise Integration A step-by-step guide to creating and running scalable Silverlight Enterprise Applications on the Windows Azure platform David Burela 88 fpafi/tl enterprise I 1 V» IV I I professional expertise distilled PUBLISHING - BIRMINGHAM MUMBAI
Preface 1 Chapter 1: Getting Started 7 Installation 7 Visual Studio 2010 8 Web platform installer 8 Useful tools 10 Official Windows Azure Tools for Visual Studio 10 Azure Storage Explorer 11 Expression Blend 12 Silverlight Toolkit 13 Telerik Silverlight controls 13 Silverlight Spy 14 LINQPad 14 Creating a Windows Azure account 16 Deploying to Windows Azure from Visual Studio 2010 17 Creating the hosting service 17 Creating the storage account 19 Deploying applications onto Azure servers 20 Creating certificates to authenticate deployment 22 Summary 27 Chapter 2: Introduction to Windows Azure 29 Windows Azure 29 Main components of Windows Azure 31 Windows Azure compute services 33 Role types 33 Example usage of roles 34 Compute fabric 35 Things to be aware of when working with role instances 37 Compute instance sizes 38
Windows Azure storage services 38 SQL Azure 40 Windows Azure AppFabric 40 Developing applications locally 41 Summary 42 Chapter 3: Hosting Silverlight Applications in Azure 43 Combining Silverlight and Windows Azure projects 43 Creating a Silverlight or Azure solution 44 Running an Azure application on the Azure compute emulator 50 Consuming an Azure-hosted WCF service within a Silverlight application 51 Configuring the number of web roles 57 Summary 60 Chapter 4: Using Azure Queues with Silverlight 61 Fundamentals of Azure storage services 62 Accessing storage services through REST APIs 63 Accessing storage services with storage client library 63 Using shared keys to access storage services 64 Collocation of storage and computer services 65 Local storage emulator 66 Azure Storage Queue service 66 Queue service operations 68 Using queues for application scalability 68 Message durability 70 Queuing work from a Silverlight application 71 Handling poison messages 82 Summary 83 Chapter 5: Accessing Azure Blob Storage from Silverlight 85 Azure Blob storage 85 Available commands 87 Behind the scenes 88 Creating, listing, and displaying files with Silverlight 89 Generating files with a web role and displaying in Silverlight 90 Retrieving and displaying the files from Azure Blob storage in Silverlight 98 Using the shared access signatures to upload from Silverlight 101 The Azure Content Delivery Network (CDN) 108 Benefits of using CDN with Silverlight 110 Enabling the CDN on an Azure storage account 112 Location of CDN edge nodes 114 Summary 115
Chapter 6: Storing Data in Azure Table Storage from Silverlight 117 Azure Table storage 117 Accessing Azure Table storage 117 Querying Azure Table storage 118 Under the covers 119 Partitions 120 Flexible schema 121 Concurrency and transactions 122 Azure Table storage versus SQL Azure 122 Scalability 123 So which one should you choose 123 Using Azure Table storage from Silverlight 124 Interacting with Table storage and creating a WCF service 124 Creating the Silverlight application 133 Summary 139 Chapter 7: Relational Data with SQL Azure and Entity Framework 141 SQL Azure 141 SQL Azure versus Table storage 142 Underlying architecture 142 Sharding data with SQL Azure Federations 144 What Entity Framework is 145 Development options 146 Using SQL Azure in Silverlight 147 Configuring SQL Azure 147 Creating the Entity Framework model 152 Creating the WCF service 161 Creating the Silverlight application 164 Summary 172 Chapter 8: RIA Services and SQL Azure 173 RlA Services 173 Architecture 174 Querying a domain service 175 Tracking changes 175 RIA Services toolkit 176 Using Silverlight with RIA Services, SQL Azure, and Entity Framework 176 Configuring SQL Azure 176 Entities Domain service 181 177
Creating the first Silverlight screen 184 Using a Domain Data Source to access data 188 Paging, sorting, filtering, and child objects 193 Under the covers of RIA services 199 Summary 201 Chapter 9: Exposing OData to Silverlight Applications 203 OData 203 Value for the enterprise 204 Accessing data 204 URI construction 205 OData versus RIA Services 206 Consuming OData services 207 Using Internet Explorer 208 OData Explorer 214 Using Silverlight 214 Consuming OData on other platforms 220 Sharing data by using OData 220 Creating your own OData services 221 RIA Services domain service with Entity Framework and SQL Azure 221 WCF Data Services with SQL Azure 227 Summary 230 Chapter 10: Web-scale Considerations 231 Asynchronous processing and componentization 231 Naive website example 232 Asynchronous website example 234 CQRS (Command Query Responsibility Segregation) 236 Additional resources 238 Implementing CQRS with Azure 239 Globalizing your applications 240 Summary 242 Chapter 11: Application Authentication 243 Windows Identity Foundation and Azure Access Control Service 243 ASP.NET providers 244 Using the SQL Azure provider 245 Using the Azure Storage provider 251 Windows authentication 256 Summary 257
Table ofcontents Chapter 12: Using Azure AppFabric Caching to Improve Performance 259 Data caching 259 Caching lifecycle 260 Caching issues 261 Azure AppFabric caching 262 Caching raw data in AppFabric 263 Provisioning the AppFabric cache service 264 Creating the RIA Services application 266 Implementing caching 270 ASP.NET session caching 277 Summary 277 Index 279