Click here to Skip to main content
15,867,835 members
Articles / All Topics

PnP Provisioning Engine

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
10 Nov 2015CPOL2 min read 5.8K   1   1
PnP provisioning engine

Today, let’s explore the Microsoft patterns and practices or PnP Provisioning Engine solution to provision SharePoint artifacts. The way this works is the business users and designers make the required changes to the UI from the browser in one site. After that, we can import this entire configuration. Then, we can create new sites or artifacts using this configuration.

Get the solution from the PnP github repository https://github.com/OfficeDev/PnP/tree/master/Solutions/Provisioning.Framework.Cloud.Async. Ensure that you set the url of your tenancy for the Provisioning.Framework.Cloud.Async project.

If you get any error such as ‘type or namespace OfficeDevPnP could not be found’, install the OfficeDevPnP.Core NuGet package. Right click on the project -> Manage NuGet packages and ensure you are on the online tab and search for the OfficeDevPnP.Core and install it. Accept any license pop ups. Note that this step is not usually required. If you just build the project which you got from github, the required NuGet packages will be installed.

Install NuGet OfficeDevPnPCore

Now if you build and run the application, you should get a trust prompt. Click on ‘Trust it’.

It will load the default page of the provider hosted app, which is the Site Collection Creation Form. It will pick up the reference site from the web.config appSettings key TemplateSiteUrl. The base url will be picked from this url as well.

The solution will create and update the ClientId and ClientSecret in the web.config. Copy that and paste that in the other files in the solution such as app.config by searching for it.

Also getting the AccountName and AccountKey for Office 365 is a bit tricky. I almost gave up, but finally found this.

Go to Office 365 admin center. Click on the Import tab.

Then, click on the + symbol and ‘Upload files over network’

Import Office 365 Settings

Click on Show key. This is your AccountKey. Then, click on the Show URL for Email PSTs. The string between the https:// and blob.core.windows.net is your AccountName.

Getting AccountName and AccountKey

Search and update the solution with the AccountName and AccountKey values which you got from above.

Now, when you run the solution, the app will load with the ‘Site Collection Creation’ form.

Site Collection Creation Form

Once you click on Create, it will go ahead and place a request for the site collection as this is asynchronous.

Site Request Submitted

All the customizations including the lists and libraries, views and any other customizations will be present in the new site.

This is not based on a template or site definition. It creates a new site and then updates the configurations using the object model. This is more robust as it is not dependent on the template files on the file system. Or, it is only dependent on the out of the box files provided by SharePoint.

The post PnP Provisioning Engine appeared first on SharePoint Guide.

This article was originally posted at http://www.thesharepointguide.com/pnp-provisioning-engine

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionNice but PNP powershell provisioning in better Pin
masbaaz28-Mar-18 2:34
masbaaz28-Mar-18 2:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.