Skip to content

Commit 7728f8a

Browse files
erwinvanhunenVesaJuvonen
authored andcommitted
Pn p provisioning updates (SharePoint#4841)
* Added PnP Provisioning Engine Updates * fixed typo
1 parent 56ace86 commit 7728f8a

14 files changed

+424
-251
lines changed

docs/solution-guidance/Introducing-the-PnP-Provisioning-Engine.md

Lines changed: 140 additions & 212 deletions
Large diffs are not rendered by default.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Configurating the PnP Provisioning Engine
3+
description:
4+
ms.date: 10/29/2019
5+
localization_priority: Priority
6+
---
7+
8+
# Configuring the PnP Provisioning Engine
9+
10+
Sometimes you do not want to extract all artifacts from a site, or only even a specific list. For that the PnP Provisioning Engine uses a JSON formatted configuration file which gives you detailed control over the process.
11+
12+
## Extraction Configuration
13+
14+
There is a JSON schema available at https://aka.ms/sppnp-extract-configuration-schema. We will automatically update the schema referred to by that URL to a later version if new functionality comes available.
15+
If you create a JSON file use a modern editor, like Visual Studio Code, and you reference this schema will there willl be intellisense and descriptions of all the properties you can set.
16+
17+
Let's have a look at the following sample configuration
18+
19+
```json
20+
{
21+
"$schema":"https://aka.ms/sppnp-extract-configuration-schema",
22+
"handlers": [
23+
"Lists",
24+
"WebSettings",
25+
"Pages"
26+
]
27+
}
28+
```
29+
30+
This will tell the engine to only extract lists, the web settings (which includes the title, logo etc.), and the home page.
31+
32+
For some of the handlers we can specify more detail configuration options:
33+
34+
```json
35+
{
36+
"$schema":"https://aka.ms/sppnp-extract-configuration-schema",
37+
"persistAssetFiles": true,
38+
"handlers": [
39+
"Lists",
40+
"WebSettings",
41+
"Pages"
42+
],
43+
"lists": {
44+
"lists": [
45+
{
46+
"title": "My Test List",
47+
"includeItems": true,
48+
"query": {
49+
"includeAttachments": true
50+
}
51+
}
52+
]
53+
},
54+
"pages": {
55+
"includeAllClientSidePages": true
56+
}
57+
}
58+
```
59+
60+
Using the configuration above we limit the extraction of lists to only include the list called "My Test List". We're telling the engine that we do want to export list items to the template (they will show up as DataRow elements), and we tell the engine also to include any attachments if present. However, the engine will not download those attachments unless you set the ```persistAssetFiles``` property to ```true```.
61+
62+
Notice that you can specify more configuration options for lists, and we advice you to explore the schema further.
63+
64+
By default the engine only exports the home page if you specify the ```Pages``` handler. If you want to include all pages, set the ```includeAllClientSidePages``` property in the ```pages``` section to true.
65+
66+
## See also
67+
68+
- [SharePoint Patterns and Practices](https://github.com/SharePoint/PnP/)
69+
- [SharePoint Developer Group at Microsoft Tech Community](https://techcommunity.microsoft.com/t5/SharePoint-Developer/bd-p/SharePointDev)
70+
- [PnP remote provisioning](pnp-remote-provisioning.md)
Loading
Loading

docs/solution-guidance/pnp-provisioning-engine-and-the-core-library.md

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ The PnP provisioning engine is the heart of the provisioning framework, and at i
1111

1212
Comprised of extension methods on the SharePoint CSOM/REST object model, the Core library enables provisioning tasks such as enumerating and getting provisioning templates as well as storing and then applying templates to new and existing sites. It also allows you to automate provisioning tasks and to introduce coded logic into your provisioning routines.
1313

14-
> [!NOTE]
15-
> Office 365 CLI is an open-source tool with active community providing support for it. There is no SLA for the open-source tool support from Microsoft.
16-
1714
> [!NOTE]
1815
> To see a video walkthrough of creating, persisting, and applying a provisioning template, go to [Getting Started with PnP provisioning engine](https://channel9.msdn.com/blogs/OfficeDevPnP/Getting-Started-with-PnP-Provisioning-Engine).
1916
@@ -27,34 +24,47 @@ You can use one of two approaches for extracting your site design as a provision
2724

2825
### Using Windows PowerShell scripting to extract a provisioning template
2926

30-
To use Windows PowerShell scripts with the provisioning engine, you first must download and install the PnP PowerShell cmdlets. Everything you need to run Windows PowerShell, including download and installation instructions as well as the Windows PowerShell command documentation, is available in the [SharePointPnP.PowerShell Commands](https://github.com/SharePoint/PnP-PowerShell) repository on GitHub.
27+
To use Windows PowerShell scripts with the provisioning engine, you first must download and install the PnP PowerShell cmdlets. Everything you need to run Windows PowerShell, including download and installation instructions as well as the Windows PowerShell command documentation, is available in the [PnP PowerShell Commands](https://github.com/SharePoint/PnP-PowerShell) repository on GitHub.
3128

3229
> [!NOTE]
33-
> The SharePointPnP.PowerShell Commands repository contains three versions of the Windows PowerShell commands MSI. Two are for on-premises use (one for SharePoint 2013 and one for SharePoint 2016), and the third one is for SharePoint Online.
30+
> The PnP PowerShell Commands repository contains four versions: one for SharePoint 2013, one for SharePoint 2016, one for SharePoint 2019 and one for SharePoint Online.
31+
32+
The recommended way to install the cmdlet is by using the PowerShell gallery:
33+
34+
```powershell
35+
Install-Module -Name SharePointPnPPowerShellOnline
36+
```
37+
38+
In case you want to install a version for SharePoint on-premises, substitute 'online' in the name with the respective version of SharePoint.
39+
40+
These are the links to the latest versions:
41+
42+
* [SharePoint 2013](https://www.powershellgallery.com/packages/SharePointPnPPowerShell2019)
43+
* [SharePoint 2016](https://www.powershellgallery.com/packages/SharePointPnPPowerShell2019)
44+
* [SharePoint 2019](https://www.powershellgallery.com/packages/SharePointPnPPowerShell2019)
45+
* [SharePoint Online](https://www.powershellgallery.com/packages/SharePointPnPPowerShellOnline)
3446

35-
The SharePointPnP.PowerShell Commands repository contains contents that enable you to build a library of Windows PowerShell commands that target SharePoint Online. The commands use CSOM and can work against both SharePoint Online and SharePoint on-premises, depending on which MSI package you install.
3647

37-
Additionally, there is a short Channel 9 video, [Introduction to PnP PowerShell Cmdlets](https://channel9.msdn.com/blogs/OfficeDevPnP/Introduction-to-PnP-PowerShell-Cmdlets), that discusses installing the Windows PowerShell package and connecting to your Office 365 site. In addition to installation and connection activities, the video covers other valuable information about using Windows PowerShell for remote provisioning.
3848

3949
### Using CSOM code to extract a provisioning template
4050

4151
To employ CSOM/REST code to extract a provisioning template, you simply create a development project by using Visual Studio or another development environment. Create any type of project—for example, a console or Windows application, or a SharePoint Add-in. After you create a development project, you must then install the Core library, which is available as a NuGet package.
4252

4353
> [!NOTE]
44-
> Instructions for locating and installing the Core library NuGet package, and a walkthrough for a remote provisioning sample console application, are available in [Provisioning console application sample](provisioning-console-application-sample.md). Note that the Core library comes in two versions: one targets SharePoint Online, SharePoint, and Office 365; and one targets SharePoint on-premises.
54+
> Instructions for locating and installing the Core library NuGet package, and a walkthrough for a remote provisioning sample console application, are available in [Provisioning console application sample](provisioning-console-application-sample.md). Note that the Core library comes in two versions: one targets SharePoint Online and one targets SharePoint on-premises.
4555
4656
While detailed instructions for using CSOM are in the provisioning console application sample, the general overview is like this:
4757

48-
1. Create a connection to Office 365.
58+
1. Create a connection to SharePoint Online.
4959

5060
2. Create a **ClientContext** instance and retrieve a reference to a **Web** object.
5161

5262
3. Use the Core library's extension method, **GetProvisioningTemplate**, to extract a **ProvisioningTemplate** object.
5363

5464
4. Save the provisioning template instance to a file ___location of your choice by using a template provider and serialization formatter.
5565

56-
> [!NOTE]
57-
> Because the template provider and the serialization formatter objects can be customized, you can implement whatever persistence storage and serialization format you like. Out-of-the-box, the PnP provisioning engine provides support for file system, SharePoint, and Azure Blob storage template providers. It also supports XML and JSON serialization formatters.
66+
> [!NOTE]
67+
> Because the template provider and the serialization formatter objects can be customized, you can implement whatever persistence storage and serialization format you like. Out-of-the-box, the PnP provisioning engine provides support for file system, SharePoint, and Azure Blob storage template providers. It also supports XML and JSON serialization formatters.
5868
5969
You can see an example of the XML serialization output and learn more about the XML serialization schema in the [PnP provisioning schema](pnp-provisioning-schema.md) article. You also can get the schema and its documentation on GitHub: [SharePoint/PnP-Provisioning-Schema](https://github.com/SharePoint/PnP-Provisioning-Schema/). The Channel 9 video [Deep dive into PnP provisioning engine schema](https://channel9.msdn.com/blogs/OfficeDevPnP/Deep-dive-to-PnP-provisioning-engine-schema) introduces and discusses the schema.
6070

@@ -85,8 +95,6 @@ ProvisioningTemplate template = ctx.Web.GetProvisioningTemplate(ptci);
8595

8696
### Apply the provisioning template
8797

88-
As with extracting the provisioning template, you can apply your customized **ProvisioningTemplate** object instance by using either CSOM/REST code or Windows PowerShell commands. You can download the [SharePointPnP.PowerShell Commands](https://github.com/SharePoint/PnP-PowerShell) from the repository on GitHub.
89-
9098
If applying the provisioning template by using extension methods of the Core library, you have a code block similar to the example here. In the example, the template is applied to the target site by using the **ApplyProvisioningTemplate** extension method of the **Web** type.
9199

92100
```csharp
@@ -118,16 +126,6 @@ using (var context = new ClientContext(destinationUrl))
118126
}
119127
```
120128

121-
<br/>
122-
123-
After you have created a connection to SharePoint Online by using the Windows PowerShell commands, employ the **Apply-PnPProvisioningTemplate** cmdlet as shown here.
124-
125-
```powershell
126-
Apply-PnPProvisioningTemplate -Path "PnP-Provisioning-File.xml"
127-
```
128-
129-
Note that the `-Path` argument refers to the file path to the provisioning template file that you persisted to the file system. In the code block above, the persisted file is an XML file, but these template files can be persisted in any serialized format that you wish.
130-
131129
## PnP Core library
132130

133131
The Core library (OfficeDevPnP.Core) is a CSOM/REST object model that supports the PnP provisioning framework and enables the PnP provisioning engine. It consists of several namespaces, including a set of [extension methods](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). These methods extend the SharePoint object model to support remote provisioning as well as objects for handling entities, timer jobs, provisioning templates, and the entirety of the provisioning framework. Table 1 lists namespaces in the Core library.

docs/solution-guidance/pnp-provisioning-framework.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ localization_priority: Priority
99

1010
The PnP provisioning framework provides a code-centric and template-based platform for provisioning your site collections. The new provisioning engine allows you to persist and reuse provisioning models in Office 365 and SharePoint Online as well as on-premises site collections.
1111

12-
> [!NOTE]
13-
> Office 365 CLI is an open-source tool with active community providing support for it. There is no SLA for the open-source tool support from Microsoft.
14-
15-
1612
## Why the new approach?
1713

1814
With the introduction of SharePoint Add-ins and the add-in model (formerly known as the "app model"), Microsoft has moved away from sandboxed and full-trust solutions in favor of provider-hosted add-ins and on-premises solutions. These innovations have driven a retooling of the provisioning model and the introduction of a new provisioning engine.

0 commit comments

Comments
 (0)