620 likes | 631 Views
Learn how to convert SharePoint on-premise apps to Office 365 to ensure compatibility with the latest technologies and avoid potential pitfalls. Understand the differences between on-premise and cloud-based solutions, the deprecation of certain features, and the importance of utilizing Client Side API. Get insights on transitioning to 365, adapting to new development practices, and optimizing your applications for the future.
E N D
Converting SharePoint on-premise Apps to Office 365 Jos Auker-Woor M377
Glossary Depreciated No further development by Microsoft May still work at the moment May disappear in the future Will not support new functionality May in on-premise but not 365
Why Now? New 365 Customers Existing customers asking about 365 2016 and beyond Easier to develop and support
2007 – Big Push: SharePoint the development platform Server side code Products but also customisation
Solutions and Features Server and client side API Well understood 2016 on premise On premise only Dangerous? Needs outage to install Future?
Client Side API Both Depreciated
SharePoint Hosted - Client Side API Provider Hosted – External (e.g. Azure), connecting via Client API
SharePoint SharePoint Hosted The app and all resources are hosted in your SharePoint farm. Still relies on client side API to access SharePoint. Full Appincluding code
On Premise and Cloud Think… Scoped to a Single Site Collection Point solutions, localised web parts etc. Client side API Painful updates No easy access to remote data Browser based code JavaScript, HTML
SharePoint SharePoint Hosted The app and all resources are hosted in your SharePoint farm. Still relies on client side API to access SharePoint. Full Appincluding code Provider Hosted On-premise, datacentre or Azure hosted application that links to SharePoint. App Stub in SharePoint to handle authentication via OAuth. App ‘Stub’ OAuth Client API
On Premise and Cloud External to SharePoint Easy updates (but everyone gets them) Access data remote data Client side API ‘Provider’ and Browser based code JavaScript, C#, anything Dedicated Server/Site Azure
Consistent Styling Include pages, menus, etc. Can cross site collections Store settings Multiple customers Bulk data access
We had concerns so… SharePoint Hosted?
Consistent Styling Include pages, menus, etc. Can cross site collections Store settings Multiple customers Bulk data access
Consistent Styling Include pages, menus, etc. Can cross site collections Store settings Multiple customers Bulk data access
Demo Patterns and Practices: https://github.com/OfficeDev/PnP Provider Hosted App Full immersion
Server Side vs Client Side SPListlist = SPContext.Current.Web.Lists["News"]; SPListItemitem = list.GetItemById(1); lTitle.Text = item["Title"].ToString();
Server Side SPSecurity.RunWithElevatedPrivileges(() => { using (SPSitesite = new SPSite("http://server/site/subsite/")) { using (SPWeb web = site.OpenWeb()) { SPListlist = web.Lists["News"]; SPListItemitem = list.GetItemById(1); lTitle.Text = item["Title"].ToString(); } } });
Server Side Web Part Settings Property Bag Web Site Collection Web App (root site collection) Web.AllProperties.Add(id, value); … string value = web.AllProperties[id];
Azure DocumentDB • JSON • No need for pre-defined schema • Standard Queries • Easy to connect from C#, Javascriptetc
Throttling – Possible causes • Repeated actions • Bulk updates • Looks like load testing
Throttling • No Published Rules • Excellent MSDN Article: dn889829 • https://msdn.microsoft.com/EN-US/library/office/dn889829.aspx • Almost always code
Throttling – Two Stage • 429 – To many requests • 503 – Server Unavailable
Throttling - Avoiding • ClientContext.ExecuteQueryWithIncrementalRetry(retries,delay) • E.g.ctx.ExecuteQueryWithIncrementalRetry(5, 30000); • Cache where possible, Keep calls to a minimum • Make actions ‘irregular’
Normal List Throttling Applies SP.ListItemCollectionPosition position = null; stringcaml = "<View><ViewFields><FieldRef Name=‘Title'/>" +"</ViewFields><RowLimit>5000</RowLimit></View>"; do { SP.CamlQueryquery = new SP.CamlQuery() { ListItemCollectionPosition = position, ViewXml = caml }; SP.ListItemCollectionresults = list.GetItems(query); ctx.Load(results); ctx.ExecuteQuery(); position = results.ListItemCollectionPosition; // Do something here with results } while (position != null);
MyApp - Australia DocumentDB SQL Etc
MyApp - Australia DocumentDB SQL Etc
MyApp - Australia DocumentDB SQL Etc MyApp2 - Singapore
Traffic Manager MyApp Traffic Manager MyApp1 - Australia DocumentDB SQL Etc MyApp2 - Singapore
Traffic Manager MyApp Traffic Manager MyApp1 - Australia DocumentDB SQL Etc MyApp2 - Singapore