SharePoint Cincinnati 2018 presentation.
For a SharePoint on-premises implementation, a separate farm would be setup for development, testing and productions environments. This would inherently isolate each of these environments from one another. However, when developing on a single tenant for SharePoint Online each of these environments would be site collections rather than farms, which means they cannot have the same relative URL and will share SharePoint services like Search, User Profiles and Managed Metadata. This session will cover various development practices that will help establish the same isolation of environments on SharePoint Online as SharePoint on-premises.
3. About Me
Principal Consultant & Team Lead
fsikorski@cardinalsolutions.com
https://www.linkedin.com/in/fsikorski85
FRANK
SIKORSKI
Business Productivity
• Started SharePoint consulting in 2011
• SharePoint 2010, 2013, 2016
• SharePoint Online
• Types of work
• Development
• Governance
• Information Architecture
• Administration
• Work with clients in various industries
• Financial
• Law
• Fast Food
• Automotive
• Distilled Spirits
4. MY AGENDA TODAY
Code Promotion Practices
On-Premise vs SharePoint
Remote Provisioning
Development Practices
1
2
3
4
5. Code Promotion Practices
Development
• Programming
• Unit Testing
• Could be developer
specific
• Loosely Controlled
Test / QA
• Code Integration Testing
• User Testing
• Functionality Sign-off
• Deployment Dry Run
Production
• End User Environment
• Highly Controlled
7. On-Premise vs Online
On-Premise Online
Development
http://intranet-dev.company.com
Search
Managed
Metadata
User Profile
Test / QA
http://intranet-qa.company.com
Search
Managed
Metadata
User Profile
Production
http://intranet.company.com
Search
Managed
Metadata
User Profile
Development
https://company.sharepoint.com/sites/dev
Searc
h
Managed
Metadata
User
Profile
Test / QA
https://company.sharepoint.com/sites/qa
Production
https://company.sharepoint.com
8. On-Premise vs Online
Server-side and Client-side
Code
Farm Solutions,
Sandbox Solutions
Custom Master Page
On-Premise Online
Development
Client-side Code
Sandbox Solutions (declarative),
Remote Provisioning
Alternate CSS,
Custom Actions (ScriptLink)
9. Remote Provisioning
• Classic Experience
• Client Side-Object Model
• SharePoint Patterns and Practices (PnP) utilities
• Visual Studio .NET Website
• Alternatives: Console App, WinForms, PowerShell
Overview
10. Remote Provisioning
• Solution
• How Projects are built and deployed
• Project
• Property definitions
• Default Configurations
• Debug
• Release
Visual Studio Configuration Manager
12. Remote Provisioning
• JavaScript object changed at deployment based on appSetting
• Environment Flag
• Term Store Names
• User Profile Property Names
File Manipulation
var CSGEnvironment = {
Environment: "{ENVIRONMENT}",
TermSetGlobalNav: "{TERM_SET_GLOBAL_NAV}",
UserProfileFavorites: "{USER_PROFILE_FAV}"
};
16. Development Practices
• Dynamically adjust URL for REST calls
• Each environment different relative path
• Leverage _spPageContextInfo global JS variable
• siteServerRelativeUrl
• webServerRelativeUrl
Querying Lists
var restURL = _spPageContextInfo.siteServerRelativeUrl + "/_api/web/lists/getByTitle('ListTitle')/items?$select=ID,Title"
17. Development Practices
• Custom Webpart REST API Calls
• Same dynamic url as list querying
• KQL Query Tokens
• Scopes
• Site, Page, User, Terms, Lists
• {Site.URL}
• Path:{Site.URL}/Pages
SharePoint Search
18. Development Practices
• Use globally defined constants
• CSGEnvironment.Environment
• CSGEnvironment.TermSetGlobalNav
• CSGEnvironment.UserProfileFavorites
Using Environment Object
20. References
• Blog Post
• https://www.cardinalsolutions.com/blog/2017/05/developing_for_mulitpl
e_environments_in_sharepoint_online
• KQL Information
• KQL query language syntax reference
• Query Variable in SharePoint
• SharePoint Patterns and Practices
• https://dev.office.com/patterns-and-practices