Microsoft ® Official Course Creating Robust and Efficient Apps for SharePoint Microsoft SharePoint 2013 SharePoint Practice.

Slides:



Advertisements
Similar presentations
Module 1: Creating Responsive Pages with Ajax Creating Partial-Page Updates by Using AJAX Scripting Actions on the Web Client.
Advertisements

Bob German Principal Architect Introduction to Cloud Hosted Apps Your apps here!
Configuring and Troubleshooting Network Connections
Microsoft ® Official Course Client-Side SharePoint Development SharePoint Practice Microsoft SharePoint 2013.
Implementing and Administering AD FS
Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.
Microsoft SharePoint 2013 SharePoint 2013 as a Developer Platform
Microsoft ® Official Course Working with SharePoint Objects Microsoft SharePoint 2013 SharePoint Practice.
Managing Identity and Permissions
Microsoft ® Official Course Developing Remote-hosted Apps for SharePoint Microsoft SharePoint 2013 SharePoint Practice.
Microsoft ® Official Course Developing Optimized Internet Sites Microsoft SharePoint 2013 SharePoint Practice.
Microsoft ® Official Course Publishing and Distributing Apps Microsoft SharePoint 2013 Sriram – SharePoint Practice.
Microsoft ® Official Course Introducing Apps for SharePoint SharePoint Practice Microsoft SharePoint 2013.
SharePoint Server 2013 Architecture and Identity
©2012 Microsoft Corporation. All rights reserved..
Understanding Active Directory
Fraser Technical Solutions, LLC
Intro to Apps Minnesota SharePoint User Group Raymond April 2014.
©2012 Microsoft Corporation. All rights reserved. Content based on SharePoint 2013 Technical Preview and published July Introducing.
App development in SharePoint 2013 LIVE Introducing Cloud App Model Cloud-hosted Apps Experiences from the Field.
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
Any device, anywhere, anytime New discovery channels New ways of working Redefined expectations for apps.
SPC204 Security Problems in SharePoint 2010 Authentication and Authorization.
Managing Client Access
Module 4 Managing Client Access. Module Overview Configuring the Client Access Server Role Configuring Client Access Services for Outlook Clients Configuring.
Marat Bakirov Readify. 2 3 ServerClient Browser Host Web Server Host SharePoint & Exchange Office APP Client APIs Server APIs.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
What’s New for IT Professionals in Microsoft® SharePoint® Server 2013 (Day 2) Sayed Ali (MCTS, MCITP, MCT, MCSA, MCSE ) Senior SharePoint.
Module 10: Designing an AD RMS Infrastructure in Windows Server 2008.
First Look Clinic: What’s New for IT Professionals in Microsoft® SharePoint® Server 2013 Sayed Ali (MCTS, MCITP, MCT, MCSA, MCSE )
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Securing Microsoft® Exchange Server 2010
Refine Author business logic Customize screen layouts / branding Define custom queries Extend Explore ecosystem components Create custom controls.
Christopher Chapman | MCT Content PM, Microsoft Learning, PDG Planning, Microsoft.
Module 8 Configuring and Securing SharePoint Services and Service Applications.
TechEd /22/2017 5:40 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Ideas to Improve SharePoint Usage 4. What are these 4 Ideas? 1. 7 Steps to check SharePoint Health 2. Avoid common Deployment Mistakes 3. Analyze SharePoint.
Module 5: Designing a Terminal Services Infrastructure.
Module 5 Configuring Authentication. Module Overview Lesson 1: Understanding Classic SharePoint Authentication Providers Lesson 2: Understanding Federated.
Module 9: Fundamentals of Securing Network Communication.
Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server.
Module 5: Configuring Internet Explorer and Supporting Applications.
Enabling Developers with Development Features Presented by: Ricardo Wilkins SharePoint Solutions Architect.
Copyright © cs-tutorial.com. Overview Introduction Architecture Implementation Evaluation.
SharePoint Apps and the Architecture of the new Cloud App Model Introducing Cloud App Model Designing Apps SharePoint-hosted Apps Key Learnings.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Microsoft ® Official Course Developing a Publishing Site for Web Content Microsoft SharePoint 2013 SharePoint Practice.
Securing Angular Apps Brian Noyes
Microsoft ® Official Course Designing and Managing Features and Solutions Microsoft SharePoint 2013 SharePoint Practice.
Microsoft ® Official Course Implementing Enterprise Content Management Microsoft SharePoint 2013 SharePoint Practice.
Windows 8 Application Microsoft Word with an app for Office Internal O365 SharePoint Site Windows Azure Web Sites Windows Azure Workflow Service.
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Microsoft ® Official Course Module 9 Working with Business Connectivity Services.
Inspirirani ljudima. Ugasite mobitele. Hvala.. Paolo Pialorsi Senior Consultant PiaSys ( Publishing apps for SharePoint 2013 on Microsoft.
Bob German Principal Architect Future-Proof your SharePoint Customizations: Build 2010 Solutions that become 2013 Apps.
Bob German Principal Architect Developing SharePoint Applications with MVC and Entity Framework.
Trimantra Software Solution Offshore Software Development Outsourcing Company Visit :
A Developer’s Introduction to SharePoint 2013 Apps Ryan McIntyre, MCITP, MCPD National
Migrating SharePoint Add-ins from Azure ACS to Azure AD
Node.js Express Web Services
03 | Client Side SharePoint Development
SharePoint Online Hybrid – Configure Outbound Search
Windows Azure Keenan Newton 3-021
ASP.NET Module Subtitle.
Agenda OAuth Concepts Programming OAuth.
SharePoint Online Authentication Patterns
SharePoint Development
04 | Apps and SharePoint Chris Johnson | SharePoint Guru
Presentation transcript:

Microsoft ® Official Course Creating Robust and Efficient Apps for SharePoint Microsoft SharePoint 2013 SharePoint Practice

Module Overview Apps for SharePoint Communicating with SharePoint from an App Authenticating and Authorizing Apps for SharePoint Designing Apps for Performance

Lesson 1: Apps for SharePoint Discussion: Why Create Apps? Fundamentals of Apps for SharePoint The App Package Demonstration: Exploring an App Package Distributing Apps for SharePoint Installation Scopes and App Domains Infrastructure for Apps

Discussion: Why Create Apps? What are apps for SharePoint? Why create an app?

Fundamentals of Apps for SharePoint Hosting models SharePoint-hosted apps Auto-hosted apps Provider-hosted apps App webs and host webs App is installed on the host web App resources are contained within a dedicated app web Accessing app functionality Full-page apps App parts Custom actions

The App Package Packaged as.app files App manifest defines: Start page URL App properties Permissions required by the app Prerequisites App principal identifier Package can also contain: Declarative components for the app web Features for the host web (app parts and custom actions) Application components for deployment to Azure

Demonstration: Exploring an App Package In this demonstration, you will see how pages and other assets are assembled into an app package.

Demonstration: Exploring an App Package

Distributing Apps for SharePoint App Catalog Internal catalog of apps within an organization One per web application (on-premises deployments) One per tenancy (Office 365 subscriptions) Office Store Global, publicly-accessible storefront Collects payment and supports licensing Apps published subject to approval process

Installation Scopes and App Domains Each installation of an app has: A unique security identifier A unique domain Installation scopes Site Tenancy App Domains App prefix Unique app ID Top-level app web hosting domain

Infrastructure for Apps App Management Service Subscription Settings Service

Lesson 2: Communicating with SharePoint from an App Using the REST API Performing CRUD Operations with REST Using the JavaScript Object Model Developing Robust JavaScript Code Discussion: REST API versus JavaScript Object Model Resolving Errors with the JavaScript Object Model Using the Managed Client Object Model

Using the REST API The REST API is provided by the client.svc service Exposed on every SharePoint site Accessible at the site-relative path _api Constructing REST API URLs …/_api/web/lists/getbytitle("Invoices") Including OData query operators /_api/web/lists/getbytitle("Invoices")/items?$select=Title,Amount /_api/web/lists/getbytitle("Invoices")/items?$skip=10&$top=10

Performing CRUD Operations with REST Reading data Use _spPageContextInfo.webServerRelativeUrl to get the server-relative root URL of the SharePoint site Use $.getJSON() for simple requests Use $.ajax() for more complex requests Creating, updating, and deleting data Use $.ajax() Specify an appropriate HTTP verb Include the form digest in the X-RequestDigest header

Using the JavaScript Object Model Provides a client-side proxy for client.svc Interact with the server from SharePoint web pages Asynchronous programming model getSiteCollection = function () { context = new SP.ClientContext.get_current(); siteCollection = context.get_site(); context.load(siteCollection); context.executeQueryAsync (onSuccess, onFailure); } onSuccess = function () { alert(“URL: “ + siteCollection.get_url()); } onFailure = function () { alert(“Could not obtain the site collection URL”); }

Developing Robust JavaScript Code Strict JavaScript ‘use strict’; Script scope Function scope Encapsulation Use custom namespaces Use an encapsulation pattern Example: module pattern

Discussion: REST API versus JavaScript Object Model If you write JavaScript code for an app, you can use either the REST API or the JavaScript object model to communicate with SharePoint. In what circumstances would you use each approach?

Resolving Errors with the JavaScript Object Model A server-side error can cause a whole batch of operations to fail To avoid this, use an ExceptionHandlingScope Send try/catch/finally instructions to the server var scopeObject = new SP.ExceptionHandlingScope(context); // Start a try-catch-finally block var scopeBlock = scopeObject.startScope(); var tryBlock = scopeObject.startTry(); // This is the try block. tryBlock.dispose(); var catchBlock = scopeObject.startCatch(); // This is the catch block. catchBlock.dispose();

Using the Managed Client Object Model Client-side proxy for.NET applications ASP.NET MVC web applications Mobile apps Supports synchronous and asynchronous operations Similar functionality and patterns to JavaScript object model Client context object Load and LoadQuery ExecuteQuery and ExecuteQueryAsync ExceptionHandlingScope

Lesson 3: Authenticating and Authorizing Apps for SharePoint The App Security Model App Authentication Registering an App Principal Requesting Permissions Discussion: Requesting Permissions Working with Tokens Communicating Across Domain Boundaries

The App Security Model An app is a security principal Can be granted permissions Must be authenticated App principals Client ID Title Client secret Remote host domain App permissions Request permissions in app manifest All permissions must be granted when app is installed Users can only assign permissions they themselves hold

App Authentication Internal authentication Request targets an app web Request includes a SAML token for user SharePoint-hosted apps External authentication with Oauth Windows Azure ACS issues access token Access token contains app ID and user ID Auto-hosted apps External authentication with S2S Trust relationship configured by X.509 certificate exchange Remote web host server issues access token Provider-hosted apps

Registering an App Principal Registering app principals Automatic for SharePoint-hosted and auto-hosted apps Manual process for provider-hosted apps App manifest requirements Remote web.config requirements

Requesting Permissions <AppPermissionRequest Right=“Manage" Scope=" /> <AppPermissionRequest Right="Read" Scope=" /> <AppPermissionRequest Right="QueryAsUserIgnoreAppPrincipal" Scope=" /> <AppPermissionRequest Right=“Read" Scope=" >

Discussion: Requesting Permissions Review the scenario in the handbook How would you configure permission requests for this app?

Working with Tokens Working with tokens Context tokens (OAuth only) Refresh tokens (OAuth only) Access tokens (OAuth and S2S) The TokenHelper class var contextToken = TokenHelper.GetContextTokenFromRequest(Page.Request); var hostURL = Page.Request["SPHostUrl"]; using (var context = TokenHelper.GetClientContextWithContextToken(hostURL, contextToken, Request.Url.Authority)) { context.Load(context.Web); context.ExecuteQuery; }

Communicating Across Domain Boundaries Cross-domain library SP.RequestExecutor.executeAsync method Access resources in app web from remote web page Web proxy SP.WebRequestInfo object SP.WebProxy.invoke method Access resources in external domain from web page Register external domain in app manifest

Lesson 4: Designing Apps for Performance Using SharePoint Health Scores Using Client-Side Caching Optimizing Server Requests

Using SharePoint Health Scores Every web application has a health score Integer value from 0 (good) to 10 (bad) Updated every five seconds SharePoint includes health score in every response X-SharePointHealthScore HTTP header $.ajax({ type: "GET", url: _spPageContextInfo.webServerRelativeUrl + "/_layouts/15/blank.htm", success: function (data, status, xhr) { alert(xhr.getResponseHeader("X-SharePointHealthScore")); } });

Using Client-Side Caching Responsive web pages: Minimize data exchange with server Maximize use of caching Caching in apps for SharePoint Browser caches responses to GET requests Caching automatic for REST API and JSOM Content Delivery Networks (CDNs) Provide popular content (such as script libraries) Host static content Maximize use of caching

Optimizing Server Requests Minimize bandwidth consumption Specify properties you want to retrieve Include filter expressions Filtering is performed on server Minimize server round trips Use batching

Lab: Monitoring SharePoint Health Scores Exercise 1: Creating and Deploying an App Part Exercise 2: Working with Server Health Scores

Lab Scenario The IT team at Contoso has released new performance and design guidelines for SharePoint app developers. One of the guidelines is that all apps should request a health score from the SharePoint server before attempting to perform any processing. As the lead SharePoint developer, your task is to create a reference app that demonstrates how to work with health scores. Within your app, you will use an app part to poll the server periodically and display a graphical representation of the current health score.

Module Review and Takeaways