Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays 2013 - Bram de Jager


Published on

The new SharePoint App Model provides different ways of building apps. As a developer you have to choose between development techniques, hosting options and more. This session discusses the architecture, various types of apps, application identity and permissions, and how to build these different types of apps. The session contains demos covering building SharePoint-hosted apps, implementing SharePoint 2013 chrome control, setting the right permissions, and more with Visual Studio 2012.

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • SandboxedSolutionsdeprecated statement: (optioneel no-code sandboxedsolutions voorlopig wel ondersteund?)
  • Office Developer Tools RTM on Tue 4 March: VS.NET development for both apps & solutions
  • Use when app is ready for…Testing by anther person or teamUpload to Store or App CatalogUse the packages from app.publish folder
  • Open Packaging Conventions (OPC): For Packaging Data, also used for Office Open XML.
  • Legacy of Frontpage…, finally gone
  • ACS = Access Control Service (Windows Azure Access Control Service)
  • SharePoint  ACS (sendsClientID)ACS  SharePoint (sendsContext Token)SharePoint  Web Application (sends Context Token)Web Application  ACS (sends Context Token and Client Secrettovalidate)ACS  Web Application (sends Access Token)Web Application  SharePoint (sends Access Token forcommunication)
  • Debugging Remote Event Receivers with Visual Studio (Provider-hosted apps)
  • VSTO downside is distributionOffice users around the globe 1 billion (June 2010). Noteverybody has Office 2013, but it’sverylikelylots of themwillupcomingyears. VSTO:
  • Developing SharePoint 2013 apps with Visual Studio 2012 - Microsoft TechDays 2013 - Bram de Jager

    1. 1. Developing SharePoint 2013Apps with Visual Studio 2012Bram de JagerSharePoint Architect @ MacawMicrosoft Certified Solution Master: SharePoint
    2. 2. Agenda• Evolution• Apps for SharePoint• Visual Studio Tools• REST & CSOM APIs• Remote Event Receivers
    3. 3. EVOLUTIONDeveloping SharePoint 2013 Apps with Visual Studio 2012
    4. 4. Development Evolution Investment inPortals & content App discovery & management 2003 2007 2010 2013  Web Parts  LOB  Silverlight  Apps applications  CSOM  Client side  Custom limited experience server side  Sandbox  CSOM code  REST/oDat  WSP a deployment
    5. 5. Customization Options Farm Sandbox SharePoint Apps  Full trust solutions  Hosted in isolated  New Apps model  Customizations to process  Deployed from  file system of  Limited server side corporate catalog or servers SharePoint API Office Store  Hosted in same access  Manage permission process as  No external service and licenses SharePoint calls specifically  Server side  Simple install and SharePoint API upgrade process access Deprecated in  Preferred option  Classic model from SharePoint 2007 2013
    6. 6. App Development ScenariosDeployment Options Customization Options Development ToolsOn-Premise FarmInstallation Farm-Trust Solutions Web BrowserOffice 365 &SharePoint Online Sandboxed Solutions SharePoint Designer SharePoint-HostedHosted Installation app Visual Studio Provider-Hosted app Eclipse, etc Autohosted app
    7. 7. APPS FORSHAREPOINTDeveloping SharePoint 2013 Apps with Visual Studio 2012
    8. 8. App Shapes Full page Implement complete app experiences to satisfy business scenarios App Parts Create app parts that can interact with the SharePoint experience UI command extensions Add new commands to the ribbon and item menus
    9. 9. Hosting Options Provider-hosted app SharePoint Provide your own hosting environment Host Web Your Hosted SiteCloud-hosted apps- Use server code- Receive SP events- Use OAuth to access Autohosted appSP SharePoint Windows Azure + SQL Azure provisioned Host Web Azure automatically as apps are installedSharePoint-Hosted app SharePointProvisions an isolated sub web on a host web- Use SP artifacts & out-of-box web parts Host Web- Use HTML & JavaScript for UI & client-side logic- Use Workflows for middle tier logic SharePoint App Web
    10. 10. VISUAL STUDIOTOOLSDeveloping SharePoint 2013 Apps with Visual Studio 2012
    11. 11. Visual Studio SharePointTools• Development Environments – Develop against a local SharePoint server – Remote development against SharePoint Online (Office 365)• Tools – Office Developer Tools (RTM) – Download
    12. 12. Debug your app• No app registration required – SharePoint Developer Site – ClientId & ClientSecret are generated for you• IISExpress is used to host Web project – ~remoteAppUrl token update so it points to IISExpress Url (http://localhost:1234)• LocalDB is used for SQL database – Connection string updated in web.config from SQL project• Local workflow service is started & configured
    13. 13. Publish your app• SharePoint-hosted & Autohosted – No app registration required – Everything included in the .app package• Provider-hosted – Developer must acquire ClientId & ClientSecret via Seller Dashboard – SharePoint artifacts in .app package – Web assets in Web Deploy package - developer must deploy • Developer must publish & deploy SQL assets if not in Web Deploy package
    14. 14. Anatomy of an App Package Host Package App Web WS (OPC) P (from WSP) Azure
    15. 15. demoBuilding your first app
    16. 16. Demo Silly Facts• SharePoint-Hosted app – Look around • AppManifest.xml • SharePoint Artifacts – Silly Fact content type and Facts list – App Part (Client Web Part) – Custom Action (Host web)
    17. 17. REST & CSOMDeveloping SharePoint 2013 Apps with Visual Studio 2012
    18. 18. Changes from 2010 to 2013• The client.svc service extended with REST capabilities – client.svc now supports direct access from REST clients – client.svc accepts HTTP GET, PUT, POST requests – Implemented in accordance with OData protocol• CSOM Extended new APIs – Focus investment on SharePoint Server APIs – Search, Social, Taxonomy, Workflow, Analytics, Sharing, Publishing, eDiscovery, IRM, BCS, … and more
    19. 19. SharePoint 2013 Remote API _api is new alias for _vti_bin/client.svc Server Client REST CSOM OData JSON JavaScript Silverlight .Net CLR Library Library Library Custom Client Code
    20. 20. Why is REST Important?• Significant Industry Momentum• Simple and Easy to Use – Much easier to use than SOAP-based Web service – Higher productivity when using JavaScript and jQuery – Results can be returned in JSON and ATOM format – Test in a browser – Platform agnostic• Each query is submitted with a unique URL – Results can be cached by proxy servers
    21. 21. REST URLs in SharePoint2013• CSOM URLS can go through _api folder – Simplifies URLs that need to be built – Removes client.svc file name from URL• You can replace this URL –• With this URL –
    22. 22. Mapping Objects toResources• Example REST URLs targeting SharePoint – _api/web/lists – _api/web/lists/getByTitle(Announcements) – _api/web/getAvailableWebTemplates(lcid=1033)
    23. 23. App Authentication• Use OAuth for secure communications – SharePoint & web application trust third party (ACS)• Trust developed using ClientId & ClientSecret – SharePoint & ACS know the ClientId – Web application & ACS know the ClientSecret
    24. 24. Authentication, cont’d Access Control Service (ACS) ClientID ClientSecret SharePoint My Web  Access Token server Application Context Token 
    25. 25. demoUsing CSOM andREST
    26. 26. Demo CSOM and REST• Provider-Hosted app – Add web project – Chrome – Use CSOM and REST to create silly facts • User Profile (REST) • Search (REST) • Taxonomy (CSOM)
    27. 27. REMOTE EVENTRECEIVERSDeveloping SharePoint 2013 Apps with Visual Studio 2012
    28. 28. Remote Event Receivers• Where to use – Use RER to receive notification that a change has occurred – Use interface to poll SharePoint for changes – Write changes as required• Event scopes: List Item, List, Web, App• Support for the following types – Synchronous Events – Asynchronous After Events
    29. 29. Remote Event ReceiversRegister declaratively or via code string url= ""; using (SPSite site = new SPSite(siteUrl)) { using (SPWeb web = site.RootWeb) { SPList list = web.Lists[listTitle]; list.EventReceivers.Add( SPEventReceiverType.ItemAdded, url); } }
    30. 30. WRAP-UPDeveloping SharePoint 2013 Apps with Visual Studio 2012
    31. 31. Summary• The way forward for customizations on SharePoint• Build for the cloud (Office 365)• Heavily invested in CSOM and REST, allowing interaction with SharePoint
    32. 32. Try it yourselfOffice StoreOffice 365 playground
    33. 33. Information• Download – Slides – Source code –• Contact – – – – @bramdejager