www.it-ebooks.info Developing Microsoft ® SharePoint ® Applications Using Windows Azure ™ Steve Fox www.it-ebooks.info Published with the authorization of Microsoft Corporation by: O’Reilly Media, Inc. 1005 Gravenstein Highway North Sebastopol, California 95472 Copyright © 2011 by Steve Fox 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. ISBN: 978-0-7356-5662-8 1 2 3 4 5 6 7 8 9 M 6 5 4 3 2 1 Printed and bound in the United States of America. Microsoft Press books are available through booksellers and distributors worldwide. If you need support related to this book, email Microsoft Press Book Support at mspinput@microsoft.com. Please tell us what you think of this book at http://www.microsoft.com/learning/booksurvey. 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 ctitious. 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 author’s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, O’Reilly Media, Inc., 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. Russell Jones Kristen Borg Online Training Solutions, Inc. Andrew Whitechapel and Scot Hillier Jaime Odell Allegro Technical Indexing Twist Creative • Seattle Karen Montgomery www.it-ebooks.info “SharePoint has taken business by storm and developers want to take their collaborative applications built on this platform to the cloud! This book arrives right on time to ll this demand, giving you the conceptual approach and hands-on guidance to extend SharePoint in the cloud and take advantage of this powerful, accessible, next-generation cloud collaboration platform.” — Eric Swift General Manager, Microsoft SharePoint Group www.it-ebooks.info www.it-ebooks.info Contents at a Glance Welcome to SharePoint and Windows Azure 1 Getting Started with SharePoint and Windows Azure 21 Consuming SQL Azure Data 55 SQL Azure and Advanced Web Part Development 83 Using Windows Azure BLOB Storage in SharePoint Solutions 115 Integrating WCF Services and SharePoint 153 Using SQL Azure for Business Intelligence 183 Using the Windows Azure Service Bus with SharePoint 209 Using Windows Azure WCF Services in SharePoint and Ofce 243 Securing Your SharePoint and Windows Azure Solutions 279 www.it-ebooks.info www.it-ebooks.info Table of Contents Introduction xiii Welcome to SharePoint and Windows Azure 1 Welcome to the Cloud 1 What Is Windows Azure? 3 What About SharePoint? 4 Integrating SharePoint 2010 and Windows Azure 7 What Are the Possibilities? 8 Getting Ready to Develop 10 Getting Started with Windows Azure 10 Setting Up Your Development Environment 12 Windows Server 2008 R2 Hyper-V 14 Summary 20 Additional References 20 Getting Started with SharePoint and Windows Azure 21 Windows Azure Marketplace DataMarket 21 WCF Data Services and Publicly Consumable Data Feeds 21 Getting Started with Windows Azure Marketplace DataMarket 24 Integrating DataMarket Data with Excel and SharePoint 27 Integrating DataMarket Data with a Visual Web Part 35 Integrating Silverlight, Windows Azure DataMarket, and SharePoint 48 Summary 53 Additional References 53 What do you think of this book? We want to hear from you! Microsoft is interested in hearing your feedback so we can continually improve our books and learning resources for you To participate in a brief online survey, please visit: microsoftcom/learning/booksurvey www.it-ebooks.info Table of Contents Consuming SQL Azure Data 55 Introduction to Business Connectivity Services 55 What Is Business Connectivity Services? 55 External Content Types 58 Integrating SQL Azure with BCS by Using SharePoint Designer 2010 61 Securing the Connection to SQL Azure 64 Summary 82 Additional References 82 SQL Azure and Advanced Web Part Development 83 Interacting with SQL Azure Data 83 Integrating the SharePoint Server Object Model and the Entity Data Model 84 Surfacing SQL Azure Data in Bing Maps by Using the Client Object Model 99 Summary 112 Additional References 113 Using Windows Azure BLOB Storage in SharePoint Solutions 115 Overview of Windows Azure BLOB Storage 115 Integrating BLOB Storage and SharePoint 118 Creating the Application 119 Deploying the Application 129 Integrating the Application with SharePoint 133 Consuming BLOB Storage Data with a Simple Listbox 135 Consuming BLOB Storage Data with Silverlight 141 Summary 152 Additional References 152 Integrating WCF Services and SharePoint 153 Creating and Deploying a WCF Service to Windows Azure 154 Creating a Web Part 161 Creating a Silverlight Web Part 169 Creating a Custom List and Event Receiver 175 Summary 182 Additional References 182 www.it-ebooks.info Table of Contents Using SQL Azure for Business Intelligence 183 Preparing the Data 184 Creating a Report 187 Using a WCF Service to Integrate SQL Azure Data with SharePoint 193 Creating a WCF Service 193 Creating a Dashboard 199 Summary 207 Additional References 208 Using the Windows Azure Service Bus with SharePoint 209 Windows Azure AppFabric 209 Integrating with SharePoint by Using Windows Azure AppFabric 210 Creating a Service Namespace 211 Using the Service Bus to Interact with SharePoint 214 Accessing SharePoint via a WCF Service Proxy 222 Calling an On-Premises Service via the Service Bus 232 Summary 241 Additional References 241 Using Windows Azure WCF Services in SharePoint and Ofce 243 Custom WCF Services and Windows Azure 244 Modeling Data by Using Business Connectivity Services 250 Exposing the External System Data in Ofce 259 WCF Services in Windows Azure and Excel Services 265 Summary 277 Additional References 277 Securing Your SharePoint and Windows Azure Solutions 279 Options for Securing Your Applications 279 Conguring BCS Security 281 Conguring Shared Access Permissions for BLOB Storage 286 Using the Service Bus and Access Control Service 290 Using Certicate-Based Authentication 294 Using Claims-Based Authentication 299 Summary 302 Additional References 303 Index 305 www.it-ebooks.info [...]... specifically, Windows Azure provides many capabilities for you to build, debug, and host applications and data in the cloud It does this by breaking out into three core technologies, shown in Figure 1-2: Windows Azure, Microsoft SQL Azure, and Windows Azure AppFabric www.it-ebooks.info 4 Developing Microsoft SharePoint Applications Using Windows Azure Figure 1-2 The different parts of Windows Azure Windows Azure. .. Data” ■ Chapter 4, “SQL Azure and Advanced Web Part Development” ■ Chapter 5, Using Windows Azure BLOB Storage in SharePoint Solutions” ■ Chapter 6, “Integrating WCF Services and SharePoint ■ Chapter 7, Using SQL Azure for Business Intelligence” ■ Chapter 8, Using the Windows Azure AppFabric Service Bus with SharePoint ■ Chapter 9, Using Windows Azure WCF Services in SharePoint and Office” ■... www.it-ebooks.info 6 Developing Microsoft SharePoint Applications Using Windows Azure Figure 1-4 The Create gallery in SharePoint SharePoint also integrates its core out-of-the-box applications with other applications, such as Microsoft Outlook 2010, Excel 2010, and Microsoft Word 2010 Beyond that, it can be integrated with systems such as SAP, Oracle's Siebel and PeopleSoft, and Microsoft Dynamics using the... Welcome to SharePoint and Windows Azure Windows Azure Integration Approach to Integration Web Part Leverage services and data from Windows Azure Open XML Manage Windows Azure data into a document by using an OpenXML format REST Use REST (or oData standards) to interact with Windows Azure data to integrate with SharePoint Office Server Services Use JavaScript and jQuery to manage data client-side in SharePoint. .. 7) www.it-ebooks.info 10 Developing Microsoft SharePoint Applications Using Windows Azure ■ Using the Windows Azure AppFabric service bus to create a service layer for remote application integration with on-premises SharePoint data (Chapter 8) ■ Advanced uses of WCF services that are deployed to Windows Azure and SharePoint, specifically integrating BCS and WCF services and using the Excel Services... integrate SharePoint with Windows Azure This table is specific to SharePoint and Microsoft Office 2010, and some of these options require more coding than others Windows Azure Integration Approach to Integration SP COM Integrate cloud-based data with data from lists or document libraries by using the SharePoint client object model BCS Model data from Windows Azure and/or build an external list to SQL Azure. .. Azure or WCF services deployed to Windows Azure Silverlight Create a user interface against Windows Azure services or data by using Silverlight Silverlight Create a Silverlight application that uses Windows Azure deployed as a Web Part—to either SharePoint on-premises or SharePoint Online Office Consume data directly from Windows Azure or a BCS list exposing Windows Azure data through a custom task... introduction to SharePoint is Beginning SharePoint 2010 Development by Steve Fox (Wrox, 2010); and for Windows Azure, Programming Windows Azure by Sriram Krishnan (O’Reilly, 2010) Organization of This Book This book is divided into 10 chapters ■ Chapter 1, “Welcome to SharePoint and Windows Azure ■ Chapter 2, “Getting Started with SharePoint and Windows Azure ■ Chapter 3, “Consuming SQL Azure Data” ■... book: ■ A Windows 64-bit–compliant operating system (preferably Windows Server 2008 R2, but you could use Windows 7) ■ Microsoft SharePoint Foundation 2010 or Microsoft SharePoint Server 2010 (SharePoint Foundation is the free version of SharePoint and could be used for many of the exercises in this book) ■ Microsoft SharePoint Designer 2010 ■ Microsoft Office (Professional Plus) 2010 ■ Microsoft Visual... of SharePoint) has a limited set of capabilities when compared to SharePoint Server 2010, you’ll find that Windows Azure can be the port of entry for a lot of custom code For example, you can use Microsoft Silverlight as the client application (deployed as a SharePoint Web Part) to integrate WCF services deployed to Windows Azure or data deployed to Windows Azure/ SQL Azure, and bring that into the SharePoint . www.it-ebooks.info Developing Microsoft ® SharePoint ® Applications Using Windows Azure ™ Steve Fox www.it-ebooks.info Published with the authorization of Microsoft. Azure for Business Intelligence 183 Using the Windows Azure Service Bus with SharePoint 209 Using Windows