Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Migrating Full-Trust Solutions to the Cloud Scot Hillier [email protected] @ScotHillier www.itunity.com/users/scot-hillier [email protected] @ScotHillier www.criticalpathtraining.com www.microsoftvirtualacademy.com/Stu dies/SearchResult.aspx?q=hillier channel9.msdn.com/Search?t erm=hillier#ch9Search www.pluralsight.com/search/?s earchTerm=hillier Apologizing in advance Out with the old… In with the new… Apps for SharePoint SharePoint Add-Ins App Web Add-In Web App Part Add-In Part SharePoint App Model SharePoint Add-In Model Apps for Office Office Add-Ins Office App Model Office Add-In Model Agenda Branding Provisioning Sandbox Solutions SharePoint Add-Ins v Office 365 APIs The challenges Do you brand Word? Office 365 as suite-level experience. Microsoft will modify functionality without notice Existing public sites expire in 2017. New customers don’t get the capability Branding Techniques Custom colors and fonts Override colors fonts and layouts Search results JSLink User custom actions Script web parts Theming Brand the entire suite Out-of-the-box themes SharePoint Color Palette Tool https://www.microsoft.com/en-us/download/details.aspx?id=38182 Setting theme Microsoft.SharePoint.Client.ListItem themeEntry = ... web.ApplyTheme(themeEntry["ThemeUrl"] as FieldUrlValue, themeEntry["FontSchemeUrl"] as FieldUrlValue, themeEntry["ImageUrl"] as FieldUrlValue, false); web.MasterUrl = (themeEntry["MasterPageUrl"] as FieldUrlValue); web.Context.ExecuteQuery(); Alternate CSS Setting alternate CSS and logo $http({ url: "https://spsboston/_api/web", method: "POST", headers: { "accept": "application/json", "contentType": "application/json", "X-RequestDigest": digest, "X-HTTP-Method": "MERGE", "content-length": 84 }, data: { "AlternateCssUrl": "https://spsboston/SiteAssets/contoso.css", "SiteLogoUrl": "https://spsboston/SiteAssets/pnp.png" }}); Display Templates JavaScript injection methods Simply drop on page and add script Inject script into the site as a user custom action Associate JavaScript to modify a site, list, or field Script Editor Web Parts Adding User Custom Actions to a Site executor.executeAsync({ url: "../_api/SP.AppContextSite(@target)/web/usercustomactions" + "?@target='" + hostWebUrl + "'", method: "POST", body: JSON.stringify({ 'Sequence': 0, 'Description': 'CDNManager', 'Location': 'ScriptLink', 'ScriptBlock': script }), headers: "content-type": "application/json", "accept": "application/json", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val() }, success: function (data) {...}, error: function (err) {...} }) Utilizing JSLink (function () { // Initialize the variables for overrides objects var overrideCtx = {}; overrideCtx.Templates = {}; // Override field data overrideCtx.Templates.Fields = { // PercentComplate = internal name of the % Complete // View = you want to change the field rendering of a view // <dev ... = here we define what the output of the field will be. 'PercentComplete': { 'View': '<div class="progress" ... ' } }; // Register the override of the field SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx); })(); JavaScript injection challenges Each developers making their own references Old references are never updated Affects all list of the same template type JavaScript Injection with CDN Manager Provisioning Techniques SharePoint Add-In Office 365 APIs PowerShell Azure Web Sites aspx master png CSS js SharePoint Online New/Existing Sites and Webs Host Web Add-In Web Azure Web Sites aspx master png CSS js SharePoint Online New/Existing Sites and Webs PowerShell Client j SharePoint Online New/Existing Sites and Webs PnP Provisioning Engine Connect-SPOnline Get-SPOProvisioningTemplate –Out filename.xml Apply-SPOProvisioningTemplate –Web https://company.sharepoint.com –Path filename.xml OfficeDev PnP Core OfficeDev PnP Core V15 PnP Provisioning Engine Declarative Items: Host Services (SPUCHostService.exe) • Web Templates • Lists and Libraries • Site Columns and Content Types • File deployment • Custom Actions • Client Code Worker Service Untrusted (SPUCWorkerProcess.ex e) Code Proxy Process (SUCWorkerProcessProxy.exe) Sandboxed Solutions The Good The Bad and the Ugly Customize SharePoint without a farm solution: Limited server side API Declarative Features (lists, libraries, files, client side code) User Code (web parts, InfoPath forms, event receivers, workflow actions) Multi-tenant friendly Provisioned content is brittle Versioning is a black art No central way to manage, update Scalability Problems What does it all mean? Probably worse than “in doubt” No support for programmatic elements Updates are difficult and inconsistent. Orphans sometimes left behind. SharePoint Add-In Challenges Add-Ins need to be installed to a SharePoint site for app authentication Tenant-scoped installs appropriate sometimes, but not always.. User must access from SharePoint Office 365 API Benefits App Launcher and My Apps page SSO with Azure AD Develop with .NET, JavaScript, iOS, Android libraries – or use the REST API Office 365 API capabilities Mail Contacts Calendar Files Users & groups Discovery Service Included in Office 365 Subscription Users & Groups managed in Office 365 Portal Changes persisted in Azure AD Single auth flow for Office 365 Azure AD Graph, Exchange, SharePoint Device apps and web sites Admin and end-user consent Secure protocol OAuth 2.0 No capturing user credentials Fine-grained access scopes Supports MFA and federated user sign-in Long-term access through refresh tokens Application Types Custom developed Third-party, published in the gallery Office 365 SharePoint, Exchange Dynamics CRM Thousands of others Custom Applications Web Application and/or WebAPI Native Client Implicit Flow and Angular JS Specifically designed to work with Angular applications Appropriate for JavaScript apps that cannot defend a Client Secret Must explicitly enable explicit flow in the Azure manifest Implicit Flow with ADAL.JS References http://dev.office.com/ https://github.com/OfficeDev/PnP/tree/master/Samples http://www.itunity.com/users/scot-hillier https://github.com/OfficeDev/PnP/tree/master/Solutions/Core.CDNManager https://www.microsoft.com/en-us/download/details.aspx?id=38182 https://github.com/OfficeDev/PnP/tree/master/Binaries/PowerShell.Commands