sharepoint 2013 app or not to app

35
Walkthrough of SharePoint 2013 Apps -- why you should use apps over farm solutions SharePoint 2013: App or Not to App Ken Maglio SharePoint Architect World Wide Technology

Upload: kenneth-maglio

Post on 11-May-2015

1.345 views

Category:

Technology


2 download

DESCRIPTION

SharePoint 2013 Apps

TRANSCRIPT

Page 1: SharePoint 2013 App or Not to App

Walkthrough of SharePoint 2013 Apps -- why you should use apps over farm solutions

SharePoint 2013: App or Not to App

Ken MaglioSharePoint ArchitectWorld Wide Technology

Page 2: SharePoint 2013 App or Not to App

Session Evaluations• Schedule and evaluate each session you attend via our

mobile app that can be used across devices at http://spsaturday.cloudapp.net

• You will be able to evaluate a session 25 minutes before the scheduled end time

• Evaluations are stored anonymously and your feedback is appreciated

• The app will be the only method available to submit session evaluations for the event and we hope you find it intuitive and convenient

Page 3: SharePoint 2013 App or Not to App

Room Survey• Have seen SharePoint 2013?

• Installed on-prem Or O365?

• Currently a C# developer?

• Know Web-Dev Technologies (HTML5, CSS3, JS, jQuery)?

• Used JS-CSOM for SharePoint 2010?

Page 4: SharePoint 2013 App or Not to App

Agenda• Introduction to SharePoint 2013 apps• Deployment options and design patterns• Technologies used in app development• Building a SharePoint-hosted app

Page 5: SharePoint 2013 App or Not to App

setting the sceneIntroducing the new SharePoint app framework

Page 6: SharePoint 2013 App or Not to App

Introducing appsIn SharePoint 2013 everything is an app …

In strict sense: “Apps are self-contained pieces of functionality that extend the capabilities of a SharePoint site.”

New deployment method

Lowserverfootprint

Clouddriven

Appcatalog

Page 7: SharePoint 2013 App or Not to App

Isolation: App web vs Host web• Apps live in their own isolated environment; the

“app web”• The site in which they function is called the “host

web”

http://app-89af323fad5d297.apps.contoso.com/2345A235-1111-1111-1111-1253BAD3CC37

APP UID Host Web GUID

Page 8: SharePoint 2013 App or Not to App

Packaging and deployment optionsFarm

• Full access API• Server side

code• Server file level

access required• Classic model

from 2007• On-premise only

Sandbox Apps

• Partially trusted code service with limited server side code

• No file level access required

• Resource monitored

• Introduced with 2010

• Online deployment possible

• New model• Deploy from

corporate catalog or marketplace

• Limited server footprint

• Relies heavily on client-side technologies

• Online deployment possible

Page 9: SharePoint 2013 App or Not to App

SharePoint 2013 app developmentDeployment options

On-premise install

Development options Development tools

Hosted install

Office 365

Farm solution

Sandbox solution

SharePoint-Hosted appsDeveloper-Hosted apps

Azure-Hosted apps

Browser

SharePoint Designer

Visual Studio 2012/13

Dreamweaver, WebMatrix

Page 10: SharePoint 2013 App or Not to App

DemoApps from end user perspective

Page 11: SharePoint 2013 App or Not to App

Getting started with development• Local development• Has to be on Windows Server 2008 R2 (or later)• Memory reqs have gone up – TechNet recommends at

least 24 GB• Extra configuration needed for app development• Visual Studio 2012

• Remote development• Sign up for Office 365 - $3/month• Possible to use NAPA – app for building apps

Page 12: SharePoint 2013 App or Not to App

SharePoint App UX• Immersive App - app is shown full screen

with in a separate page

• Part - App is shown as a part on the SharePoint page – similar experience to web part

• UI Custom Actions – possible to make the App available through ribbon or menu actions for documents and items

See Apps for SharePoint UX design guidelines

Page 13: SharePoint 2013 App or Not to App

DemoHello world SharePoint app

Page 14: SharePoint 2013 App or Not to App

the bigger picturedeployment options, app identity and design patterns

Page 15: SharePoint 2013 App or Not to App

Basic SharePoint App architecture• Code runs “Off SharePoint

Box”• Declarative Hooks into

SharePoint• AppWeb Host in SharePoint

Page 16: SharePoint 2013 App or Not to App

Apps – three possible approaches

App Web

Parent Web

SharePoint-hosted AppProvision an isolated sub web on a parent web• Reuse web elements

(lists, files, out-of-box web parts)

• No server code allowed; use client JavaScript for logic, UX

Azure Auto-Provisioned AppWindows Azure + SQL Azure provisioned invisibly as apps are installed

Azure SharePoint Web

Get remote events from SharePoint Use CSOM/REST + OAuth to work with SPS

Cloud-based Apps

Developer-Hosted App“Bring your own server hosting infrastructure”Developers will need to isolate tenants

SharePoint

Web

Your Hosted

Site

Page 17: SharePoint 2013 App or Not to App

Hosting: cloud vs SharePointCloud Hosted Apps SharePoint Hosted Apps

Possible hosting model for almost all types of apps

Good for smaller apps

Choose your own infrastructure & technology

SharePoint based; no server-side code

May require your own hosting Automatically hosted in SharePoint

May require your own handling of multitenancy & permission management

Inherent multitenancy & isolation

Page 18: SharePoint 2013 App or Not to App

App identity• Challenge with SPS2010• Farm solutions• Full Access to Almost Everything• Risk of RunWithElevatedPrivileges• Memory Leaks – SPWeb.Dispose() not used well

• Sandbox solutions• no RunWithElevatedPrivileges• always under user context

• In SharePoint 2013 Apps have their own identity & permissions• Installing user either grants or denies permissions to host web• Permission is explicitly given for a specific scope• App identity is passed around using oAuth tokens

Page 19: SharePoint 2013 App or Not to App

App scopes• SPSite – site collection• SPWeb – site• SPList • Tenancy• Other scopes (and rights) for performing search

queries, accessing taxonomy data, user profiles, etc...• Potentially other services like Lync, Exchange

Page 20: SharePoint 2013 App or Not to App

App rights• Default rights : Read, Write, Manage and Full Control• Not possible to customize• Apps are granted permissions to a scope and all

children of the scope• Visual Stuio Assists with defining these:• Defined in declarative XML

Page 21: SharePoint 2013 App or Not to App

Access Control Service (ACS)• ACS required with oAuth implementation in

SharePoint 2013• How is the ACS server configured as the

authentication server?• Automatically done for sites in Office 365 Preview• On-premise farms, a trust to ACS must be configured.

Possible to avoid when using Server-to-server (S2S) trust

Page 22: SharePoint 2013 App or Not to App

DemoUsing App permissions

Page 23: SharePoint 2013 App or Not to App

base technologiesSharePoint 2013 REST/CSOM API

Page 24: SharePoint 2013 App or Not to App

SharePoint 2013 REST API and CSOM• Apps connect to SharePoint using

• SharePoint 2013 Client Side Object Model (CSOM)• SharePoint 2013 REST API• Javascript cross-domain library (SP.RequestExecutor.js)

• Main investments in 2013• Client.svc is extended with REST capabilities

• Easier for javascript and non .NET code• Implemented in accordance with oData protocol• Programming style is largely unchanged

• New APIs for SharePoint Server functionality• User Profiles, Search, Taxonomy, Feeds, ....

Page 25: SharePoint 2013 App or Not to App

REST URLs in SharePoint 2013• CSOM URLs can go through _api folder• Replace

http://sharepoint/_vti_bin/client.svc/web• With

http://sharepoint/_api/web

• Example REST URLs targeting SharePoint sites• _api/web/lists• _api/web/lists/List1• _api/web/?$select=title,id• /_api/web/lists/getByTitle('Consultants')/Items• ....

Page 26: SharePoint 2013 App or Not to App

ATOM XML vs JSON• Response data format selected with ACCEPT header• XML can be easier to deal with from managed code• JSON easier to deal with using Javascript• To get JSON response use “application/json”http://sharepoint/_vti_bin/client.svc/web

Page 27: SharePoint 2013 App or Not to App

DemoExploring SPS 2013 REST API

Page 28: SharePoint 2013 App or Not to App

building a hosted appThe most common app model to be used / built

Page 29: SharePoint 2013 App or Not to App

SharePoint Hosted App• App components are SharePoint components• SharePoint list, site columns, content types• CSOM and REST API• Client web part

• Key Developer skills• HTML5, CSS, Javascript• Jquery, ASP.NET AJAX• CSOM and REST API• Silverlight

Page 30: SharePoint 2013 App or Not to App

SharePoint Hosted App• Installation of App creates child site in target

site• App can add declarative items to App Web• App Web <-> Host Web communication:

CSOM/REST or Javascript cross-domain library • Full client-side extension – no server-side code

Host Web

App Web

• Custom Actions• Client-side web parts

• Lists• Site Pages• CSS files• Javascript files

Page 31: SharePoint 2013 App or Not to App

DemoBuilding a SharePoint Hosted App

Page 32: SharePoint 2013 App or Not to App

summaryCall to Action

Page 33: SharePoint 2013 App or Not to App

Housekeeping• Follow SharePoint Saturday St. Louis on

Twitter @spsstlouis and hashtag #spsstl• Play “Sponsor Bingo” to register for your

chance to win one of the many great giveaways at the end of the day

• Schedule and evaluate each session you attend via our mobile app that can be used across devices at http://spsaturday.cloudapp.net

Page 34: SharePoint 2013 App or Not to App

Silver

Thanks to Our Sponsors!

Gold Silver

Raffle

Page 35: SharePoint 2013 App or Not to App

questionsthank you for your attendance

@kenmaglio