3. With Thanks, Apologies and
Acknowledgements to Vesa
Juvonen, Erwin Van Hunen,
Paolo Pialorsi and Bert Jansen
4. What is Office 365 Developer Patterns and
Practices (PnP)
• PnP is community driven open source project where Microsoft and
external community members are sharing their learning's around
implementation practices for Office 365 and SharePoint on-premises
(add-in model). Active development and contributions happen at our
GitHub project under Dev branch and each month there is a master
merge (monthly release) with more comprehensive testing and
communications. Latest activities and future plans are covered in the
monthly community calls which are open for anyone from the
community. Download invite from http://aka.ms/OfficeDevPnPCall.
7. “We’ve heard this story so
many times, but want to
stay on doing farm solutions
at on-premises…”
Absolutely nothing wrong with that.
Evaluate your business requirements
and chose the right customization
model for you.
8. What does add-ins mean in our terminology
Classic - Full trust solutions
• ISV solutions
• Platform level customizations
to on-premises
• Custom service applications
• Custom WCF services
• SharePoint customizations, not
customer specific
customizations
Client Side Solutions
• Server side controls as
JavaScript on page layouts and
master pages
• Remote provisioning for
elements
• Embracing un-ghosted model
• SP add-in dimension with
provider hosted apps to
provide new capabilities
• Customer specific
customizations
Store add-ins
• Add-in catalog based solution
• Packaged reusable solutions
built for specific functionality
• Not only for market place or
store, but also as platform for
customer specific
customizations
SharePoint Add-Ins means all operations
which are executed outside of the server
9. xml
Content Type B
Manifest xml in the solution
package introduces the
feature framework
elements.
15templatesfeaturesFeatureA
Configuration database
Content
database
Content Type A
Content Type C
Feature framework feature
with element xml files for
content type and site
columns.
WSPpackage
1
2
3
Content type and site columns with dependency
Not recommended approach
Provisioned content types
And site columns have
dependency on element xml
files
10. These are essentially files deployed to
the site
You should follow the same “remote
provisioning pattern” that we outlined
for application artifacts such as
.webpart files, page layouts and
master pages.
Challenge with feature framework
based provisioning is that any
operation to sandbox or farm
solution will impact directly end user
sites
Note. This pic is for farm solution based provisioning, butsame challenge iswith sandbox solutions.
11. Full trust solution challenges
• Full trust solutions with ghosted files
– Implications to Disaster Recovery model
• Deployments always cause downtime
– Impact on Service Level Agreements as well as availability
– Very expensive to maintain enough Infrastructure to reach “near zero”
• Full trust solutions have to be closely analyzed
– Do you trust your solution fully?
– Complex Application Lifecycle Management processes
• Not available in Office 365 (Multi-Tenant or Dedicated vNext)
14. What is CSOM ?
• CSOM is short for the Client Side Object Model
• It allows another machines to interact with SharePoint servers to
create and operate on Content Types, Site Columns, Lists etc
• The other machine can be anything :- Windows, Linux
• The code on the other machine can be anything C#, PowerShell, PHP
etc
• It covers almost all of the functionality that the Server Side Object
Model does (Information Management Policies is an exception)
15. So What is OfficeDevPnP ?
• OfficeDevPnP was started by Vesa Juvonen, Erwin Van Hunen, Paolo
Pialorsi and Bert Jansen (and apologies to anyone I have missed) 12 – 18
months ago
• Vesa and Bert work for Microsoft and Erwin and Paolo work for other
companies
• OfficeDevPnP is a framework which has been built on top of CSOM to make
it easier for developers and IT Pros to use CSOM
• OfficeDevPnP is a community Initiative which anyone can get involved in
and contribute (ie Its OpenSource)
• Works with both SharePoint online and SharePoint On Premises
(SP2013,SP2016)
19. Evergreen and release cycle – old model
SP2007 SP2010 SP2013 SP2016
Tightly coupled
SharePoint customizations
• Specific upgrade project each time new version is introduced
• Customizations haveto be upgraded to get access on new capabilities in product
• Will cause additional costs during each release cycle of customizations
• Customization updates cause downtime each time something is changed
• Complex ALM processes forensuring quality of the code
20. Evergreen and release cycle – new model
SP2013
Loosly coupled
SharePoint customizations
SP2016 O17 O18
• You choose when and how applications are updated
• Backwards compatibility for API levelto movecustomizations crossversions
• Customizations don’t block new capabilities from SharePoint
• Customizations extend, not change SharePoint
• Customizations can be updated with minimal impact on SharePoint
Customizations will utilize services from
SharePoint and other services, but won’t
usually change out of the box services.
21. xml
Content Type B
Assetsand configurations
either using just code or with
for example xml
Content
database
Content Type A
Content Type C
PowerShell or code
provisioning the assets
using remote provisioning
pattern directly to content
database.
1
Content types do not have
any dependency and farm
solution can be retracted
without any impact to them
2
Content type and site columns with remote
provisioning
Recommended approach
22. Comparison of CSOM and OfficeDevPnP –
Creating a List
ClientContext context = new
ClientContext("http://SiteUrl");
// The SharePoint web at the URL.
Web web = context.Web;
ListCreationInformation creationInfo = new
ListCreationInformation();
creationInfo.Title = "My List";
creationInfo.TemplateType =
(int)ListTemplateType.Announcements;
List list = web.Lists.Add(creationInfo);
list.Description = "New Description";
list.Update();
context.ExecuteQuery();
#SPO Sample
$cred = Get-Credential -UserName
'pricen@njpenterprises.com' -Message "Enter SPO
credentials"
#Connect to new site and validate
Connect-SPOnline -Url
'https://njpenterprises.sharepoint.com/sites/SPS-
London-demosite99' -Credentials $cred -ErrorAction
Stop
#Create list
New-SPOList -Title "Demo list" -Template GenericList -
Url 'lists/demo'
27. Business user driven templates
Provisioning
engine
Provider Hosted
App / PowerShell
SharePoint Service
https://contoso.sharepoint.com
/sites/site
1 2
5
4
3
Template details are being extracted from actual
template sites during provisioning.
Templates can be modified and created using browser UI
and all changes are reflected to the newly created and
potentially modified sites.
30. What is the challenge with custom master
page?
Time
Oob Master
Custom Master<< Copy >>
Service updates for introducing new version of
the out of the box master page with some new
capabilities or bug fixes.
Significant differences on the outcome unless custom
master page been updated during the releases.
New custom master page is created by
copying oob master or starting from scratch
using oob master as the reference
master
Seattle.master
Version 1.0 master
Seattle.master
Version 2.0 master
Seattle.master
Version 3.0
master
contoso.master
Version 1.0 master
contoso.master
Version 1.0 master
contoso.master
Version 1.0
33. “Why are you using
CSOM/REST for
provisioning operations
and not feature
framework?”
When you provision your changes on top
of oob templates using remote APIs, you
get always all of the latest capabilities from
the services or product.
34. Summary
• What is Office 365 Developer Patterns and Practices (PnP)
• Why Do We Need The OfficeDevPnP Initiative ?
• Introducing CSOM and The OfficeDevPnP Initiative
• What is CSOM ?
• What is OfficeDevPnP ?
• What Does The OfficeDevPnP Consist Of ?
• Remote Provisioning Using OfficeDevPnP
• OfficeDevPnP Site Provisioning Framework
35. It is a community project!
Feel free to contribute with Issues,
Pull Requests and Yammer threads