getting to grips with sharepoint 2013 apps - chris o'brien

28
Getting to grips with SharePoint 2013 “apps” Chris O’Brien SharePoint MVP www.sharepointnutsandbolts.com

Upload: chris-obrien

Post on 08-May-2015

2.771 views

Category:

Documents


4 download

DESCRIPTION

Presentation at SharePoint Saturday UK, December 2012. Discusses official Microsoft guidance on apps, 3 key decisions to make on apps (for any company implementing SharePoint 2013), apps and SSL, developing apps, possible reasons to need a cloud app, 5 lessons learnt developing apps etc.

TRANSCRIPT

Page 1: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Getting to grips with SharePoint 2013 “apps”Chris O’Brien SharePoint MVPwww.sharepointnutsandbolts.com

Page 2: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Independent SharePoint consultant

Blog: www.sharepointnutsandbolts.com

Twitter: @ChrisO_Brien

LinkedIn: http://uk.linkedin.com/in/chrisobrienmvp

About me

Page 3: Getting to grips with SharePoint 2013 apps - Chris O'Brien

What is an app?

Adds some specific functionality to a siteE.g. expense reporting, time-tracking etc.

Apps should be safeA bug/performance issue cannot affect the overall stability of SharePointThe ‘engine’ may be in the cloud or on a non-SP server

Apps can be obtained from the app store (“SharePoint Store”)

Page 4: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Customising SharePoint – official guidanceMicrosoft:

The most important guidance we can give you is to develop an app for SharePoint rather than a classic solution whenever you can.

http://msdn.microsoft.com/en-us/library/jj163114(office.15).aspx

Page 5: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Why apps?

End-user familiarityPhones, Windows 8 etc.

Game-changer for Office 365No more sandbox restrictions

Reduce upgrade blockers..which would otherwise delay license revenue

Page 6: Getting to grips with SharePoint 2013 apps - Chris O'Brien

3 decisions to make on apps

Are we going to allow apps?Create infrastructure, obtain wildcard SSL certificate etc.

Are we going to allow ANY app from the SharePoint Store to be installed?

Or are we going to restrict to certain ‘approved’ apps via the internal App Catalog?

Will our own customisations be developed as apps?

Page 7: Getting to grips with SharePoint 2013 apps - Chris O'Brien

App dev fundamentals

No server-side SharePoint code

Usually no provisioning to “host” siteLists, content types etc. get provisioned to the “app web”

Deep changes to a site not possibleE.g. branding, site templates, themes etc.

Timer jobs, custom field types not possibleBUT, their end result can be achieved

Page 8: Getting to grips with SharePoint 2013 apps - Chris O'Brien

App hosting options

SharePoint-hostedJavaScript only

Cloud appProvider-hosted (YOU deal with hosting)

IIS, PHP/LAMP, something else!

Auto-hosted (O365 + Azure)E.g. automatically create database in SQL Azure

Hybrid app = combination

Page 9: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Apps and SSL

Microsoft:

Secure Sockets Layer (SSL) is a requirement for web applications that are deployed in scenarios that support server-to-server authentication and app authentication.

http://technet.microsoft.com/en-us/library/ee806885(v=office.15).aspx So do it in dev

too!

Page 10: Getting to grips with SharePoint 2013 apps - Chris O'Brien

How users obtain apps

User-driven:Public store (if enabled)Internal app catalog – admin-approved apps

Administrator-driven:Installed to selected sites via PowerShell“Tenant-install” – one shared instance (not instance per site)

Page 11: Getting to grips with SharePoint 2013 apps - Chris O'Brien

demo

Obtaining apps –Store and App Catalog

Page 12: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Developing SharePoint-hosted apps

Page 13: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Key characteristics

Even though hosted on SP, app area is on an “isolated” domain (IIS web application)

URL = https://cob-387fbe6473fd9e.spapps.dev/MyAppApp prefix (configurable)ID (generated on each install/upgrade)App domain (should be a distinct domain)App name

Effectively an IIS trick – content is in same site collection!Provides some security against XSS + allows identification of app requests

Page 14: Getting to grips with SharePoint 2013 apps - Chris O'Brien

App architecture

Page 15: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Ingredients of a nice 2013 “learning” app

Creates and uses some content types/lists/files in app web

Fetches some data from host web (cross-domain library)

Uses CSOM/REST

Provisions an app part for UX within host web

Permission requests(s) for host web

(SharePoint-hosted)

Page 16: Getting to grips with SharePoint 2013 apps - Chris O'Brien

demo

Custom SharePoint-hosted apps

Page 17: Getting to grips with SharePoint 2013 apps - Chris O'Brien

SP-hosted app with:

Fields/content typesLists/lookupsJSOM codeSearch (via REST)

Demo screenshots

Page 18: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Developing cloud apps

Page 19: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Definitions

Auto-hosted = Office 365 (SharePoint) + Azure (app)

Azure bit is a bundled/free Azure tenancy – not any existing tenancyCapacity TBA – announcements in 2013Unclear if option to use existing tenancy e.g. for large apps

Provider-hosted = you provide everythingSupport for debugging – runs on http://localhost during devFull flexibility, but more work

Page 20: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Authentication in cloud apps

Auto-hosted (O365 + Azure):EASY – handled for you with ACS/OAuth!

Provider-hosted:HARDER – no OAuth; needs manual “high-trust”/”S2S” config Certificate trust, Register-SPAppPrincipalCode against provided TokenHelper class (extensible)

(the quick story)

Page 21: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Possible reasons for cloud app

Need to go beyond JavaScript to develop functionalityE.g. service layer E.g. use of back-end non-SharePoint data

Needs Remote Event Receivers (app installed, app upgraded etc.)

Needs scheduled process

Needs distinct/complex branding

You don’t want to develop entire app in JavaScriptOR, you want to leverage .Net/PHP/whatever skills

(i.e. something more than SP-hosted app)

Page 22: Getting to grips with SharePoint 2013 apps - Chris O'Brien

demo

Custom cloud apps

Page 23: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Auto-hosted app with:

Chrome ControlWCF serviceUser controls Etc.

Demo screenshots

Page 24: Getting to grips with SharePoint 2013 apps - Chris O'Brien

5 lessons learnt

1. The host site’s URL is only accessible on 1st page load (bug)

Workaround: store in cookie/similar (see my blog)

2. JavaScript runtime error: 'Type' is undefinedJavaScript dependency issue – MicrosoftAjax.js needs to be earlier!

3. Page cannot be displayed in app partAllow Framing tag is missing from page

Troubleshooting apps

Page 25: Getting to grips with SharePoint 2013 apps - Chris O'Brien

5 lessons learnt (ctd)

4. JavaScript errors in a cloud appYou may be trying to use the JavaScript Client Object Model (JSOM) “off-box” from SharePoint – you should use REST, or .NET CSOM

5. Error occurred in deployment step 'Install app for SharePoint': Sideloading of apps is not enabled on this site

You tried to “F5 deploy” to a site not based on Developer Site template – only supported against a Developer Site

Troubleshooting apps

Page 26: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Closing thoughts

The Store could be a great thing for SharePoint

Learning curve for custom app development

User experience considerations:Separation of app from host webAccessing app from Site Contents page

What benefits is the app framework providing?

Page 27: Getting to grips with SharePoint 2013 apps - Chris O'Brien

Blog: www.sharepointnutsandbolts.com

Twitter: @ChrisO_Brien

LinkedIn: http://uk.linkedin.com/in/chrisobrienmvp

Thank you!

Want to read more or contact me?

Page 28: Getting to grips with SharePoint 2013 apps - Chris O'Brien

© 2012 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.