SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

48
Donovan Follette Solution Architect Microsoft Developing your first Provider-hosted Apps for SharePoint 2013

description

Developing Provider-Hosted Apps for SharePoint 2013

Transcript of SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Page 1: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Donovan FolletteSolution ArchitectMicrosoft

Developing your first Provider-hosted Apps for SharePoint 2013

Page 2: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Thanks to the conference sponsors!

Page 3: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Devices

1 billionsmartphones, 4 years ahead of predictions

Cloud

50%of enterprise customers are “on the road” to cloud

Trends impacting the way we workPeople

For the first time in modern history, workplace demographics now span3 generations

Page 4: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Microsoft’s productivity vision

OnlineOn Premises

Hybrid

Cloud on your terms

Messaging

Voice & Video

Content Management

EnterpriseSocial

Reporting & Analytics

Best experience across devices

Integrated best-of-breed solutions

Page 5: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Apps for Office and SharePointApps

App catalog and store

Vacation request

Event planning

Expense calculator

Learning management

Risk management

Help-desksupport

Products and platforms Services and data

Page 6: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

To enable Devs: A new Cloud App Model

The future is now.

The future is now.

Page 7: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

The Store on office.com DemoLight up new productivity scenarios with apps from the Store on office.com

Page 8: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

The what…

The why… we just covered that

The how…

The what can be…

Agenda

Page 9: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

The what…with some how…mixed in

Page 10: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

SharePoint App Hosting OptionsSharePoint

The app is hosted in the cloud. Windows Azure and SQL Server Azure components are provisioned automatically when an app is installed. SharePoint artifacts in the App Web (Available for SharePoint Online only)

Existing sites and services

App web

Existing sites and services

App web

The app and all SharePoint artifacts are hosted on your organization’s SharePoint site. Relies on client side technologies. Your IT organization supports the app.

The app and all resources are hosted by the provider in any environment suitable for the app whether on-premises or in the cloud. SharePoint artifacts in the App web

Auto-hosted

SharePointhosted

Existing sites and services

App webWindows Azure & SQL Azure

Oauth + REST or client object models

OAuth + REST or client object models

Page 11: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Shape Description ExampleImmersive Full Page App

App that implements a new scenario for customers

Resource Tracking, Budgeting

App Part Provides new parts you can add to your sites

Weather, News, Stock Ticker

Extension App Add new actions for documents and items

Display Document Visualization, Print to Print Service Vendor

Entry Point / Experience: App Shapes

Page 12: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

My first Provider-hosted app DemoAnd a close relative – the Auto-hosted app

(As Immersive apps)

Page 13: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Creating Provider-hosted Apps Create Windows Azure Web Site

Optional - create Windows Azure SQL Database Download publishing profile from Azure Create App for SharePoint in Visual Studio Update appManifest.xml

Application metadata, homepage, Client ID Update Web.config

ClientId, ClientSecret Leverage SharePoint permissions (OAuth), communication (REST / CSOM), & Chrome Control

Page 14: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

The app Principal

Page 15: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Register the App Principal for TestingUniquely identifies an app for SharePoint

Create the app principal with AppRegNew.aspxUse the app principal with OAuth for access to SharePoint APIs

http://mySPSite.sharepoint.com/_layouts/15/AppRegNew.aspx

All or nothin

g

Page 16: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

The Rich APIs

Page 17: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

JavaScript Library

Silverlight Library

.Net CLR Library

Custom Client Code

ClientSharePoint

_api

Execute Query

Supported Client TechnologiesSharePoint 2013 _api

OData / REST

Page 18: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

What’s possible with the APIs?

_api

Lists

Sites

Security

User Profiles

Search

Taxonomy

_api

Feeds

Publishing

Sharing

Workflow

E-Discover

y

IRM

Page 19: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Consistent UsageREST/ODatahttps://contoso.sharepoint.com/_api/web/Title

Managed CodeClientContext ctx = new ClientContext("https://contoso.sharepoint.com");ctx.Load(ctx.Web.Title);ctx.ExecuteQuery();

JavaScriptvar context = SP.ClientContext.get_current(); site = context.get_web(); context.load(site); context.executeQueryAsync(function(sender,args){console.log(site.get_title())});

Page 20: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

REST URLs in SharePoint 2013 CSOM URLS go through _api folder

Simplifies URLs that need to be built

Use this URLhttps://mySPsite.sharepoint.com/_api

Page 21: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Mapping Objects to Resources Example REST URLs targeting SharePoint sites _api/web/lists

_api/web/lists/getByTitle('Announcements')

_api/web/getAvailableWebTemplates(lcid=1033)

_api/search/query?querytext=‘searchTerm‘

_api/social.feed/my/Feed

_api/social.feed/my/News

_api/social.feed/my/TimelineFeed

Page 22: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Permissions

Page 23: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

(Me)

Page 24: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Photo Storing Web

Site

Page 25: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Photo Storing Web

Site

Photo Storing Web

Site

Page 26: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Photo Storing Web

Site

Photo Storing Web

Site

Photo Printing Service

Page 27: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Photo Storing Web

Site

Photo Printing Service

Photo Storing Web

SitePhoto Printing

Service

Page 28: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

?Photo

Storing Web Site

Photo Printing Service

Photo Storing Web

SitePhoto Printing

Service

Page 29: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Photo Storing Web

Site

Photo Storing Web

Site

Photo Storing Web

Site

Photo Printing Service

Photo Printing Service

Page 30: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

View

View

Photo Storing Web

SitePhoto

Storing Web Site

Photo Storing Web

Site

Photo Printing Service

Photo Printing Service

Page 31: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

View, Upload, Tag, Comment

View, Upload, Tag, Comment

Photo Storing Web

SitePhoto

Storing Web Site

Photo Storing Web

Site

Photo Printing Service

Photo Printing Service

Page 32: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

View, Upload, Tag, Comment, Change Password

View, Upload, Tag, Comment, Change Password

Photo Storing Web

SitePhoto

Storing Web Site

Photo Storing Web

Site

Photo Printing Service

Photo Printing Service

Page 33: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

View, Upload, Tag, Comment, Change Password

Photo Storing Web

Site

Photo Storing Web

Site

Photo Printing Service

Photo Printing Service

Page 34: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

View, Upload, Tag, Comment, Change Password

Photo Storing Web

Site

Photo Storing Web

Site

Photo Printing Service

Photo Printing Service

Page 35: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

View, Upload, Tag, Comment, Change Password

ViewPhoto

Storing Web Site

Photo Storing Web

Site

Photo Printing Service

Photo Printing Service

Page 36: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

View, Upload, Tag, Comment, Change Password

ViewPhoto

Storing Web Site

Photo Storing Web

Site

Photo Printing Service

Photo Printing Service

Page 37: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Apps Request Permission App Permission Scope Defines

Product Permission Provider Target object where the grant is requested

<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="Read"/>

Product PermissionProvider

TargetObject

Capability

Page 38: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

The app Principal in Authentication

Page 39: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

AuthenticationUser credentialsonly provided?Start

End

User only context

App only context

User + App

context

Anonymous context

App tokenprovided?

App tokenIncludes user?

Yes

No

No No

Yes Yes

Endpoint outsideapp web?

Yes

No

Page 40: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

The what can be…

Page 41: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

With the new cloud app model for SharePoint and its rich service APIs, your apps can now consume SharePoint better than ever before.

An end-to-end App for SharePoint solution

Page 42: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

• Business:• Company desires an on-the-go enabled toolset

for sales personnel to efficiently track/respond to sales leads and win business

• Technical:• Company wants a 100% cloud-based solution

accessible via an array of devices

Scenario Overview

Page 43: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

End-to-end Provider-hosted app DemoLead Tracking app for SharePointPowered by Office 365, Windows Azure, Windows 8 & more…

Page 44: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Windows 8 Application

Microsoft Word with an app for Office

Internal O365 SharePoint Site

Windows Azure Web Sites

Workflow Manager

Public O365 SharePoint Site Windows

Azure SQL Database

Clients (Desktop/Tablet/Mobile) Cloud

• View / approve SOWs• Display Excel Services

charts in Word

• View client companies• View sales leads• Receive toast and tile

and raw notifications• View Excel Services

charts• Create estimates

• Contact internal sales personnel to follow up on requests for quotes

• Contact vendors to follow up on requests for quotes

• Approve SOWs• Store Excel Documents• Store SOWs• Host team sites for projects• BCS Sales Leads External List

• Submit requests for quote

• Send notifications• Create SOWs• Update data in Excel

documents• Create SharePoint project

sites

• Facilitate SOW creation, approval, submission, and follow up tasks

• Store sales request data

Windows AzureAccess Control Service• OAuth

Page 45: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

• The why…• It’s an ever emerging day for the cloud, devices and services

• The what…• The app model, _api, REST/CSOM, apps with Identity, and more…

• The how…• Code build and deploy

• The what can be...• A look at an end-to-end solution

Summary

The future is now.Build some fantastic apps!

Page 46: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

Make plans to:

Page 47: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

All things Apps (Sign up for a O365 Dev Site!)dev.office.com

Apps for Office and SharePoint Blogblogs.msdn.com/b/officeapps

My Blogblogs.msdn.com/donovanf

[email protected]

Resources

Page 48: SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013

© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.