If you have been playing around with the Site Provisioning in the PnP Partner Pack you might have run into problems when installing it. While the instructions are rather good there are still some problems which I ran into and are not mentioned in the instruction(or I might have just passed by them).
Notice that the things mentioned here assumes that you have read or understand how to install the site provisioning web app by this instruction:
Anyway here is what is good to know:
Sign-ON URL format:
When you are defining your Sign-On URL in the Configure section for your application, there is a very weird and annoying error that the site provisioning web application might throw. This is due that you are missing one single character from the end of your URL which is: /
URL which does not work: https://pnpprovisioning82.azurewebsites.net
URL which does work: https://pnpprovisioning82.azurewebsites.net/
Do you see the difference :)? Small but enough to make you wonder. The error message is not necessarily very informative and unfortunately I do not have that error message anymore, can paste it here. Just check this thing in case of errors.
The web jobs are good and working BUT the installation is a bit misleading. I had to figure out for myself and gather the info from different locations. My problem was that the script which was supposed to install the jobs automatically did not work. Some error which did no make sense and I did not want to spend time figuring out. If it works for you then that is great. If not you might have to do this manually.
You have different way on how to do this manually:
- Through Azure portal management
- Through visual studio
Azure portal management
- Build a release version of the webjob
- Just zip the entire release folder and rename your zip package
- Go to your web application web jobs section
- Click add a new job and upload your ZIP file and define how you want your job to run
On the web job project which you want to upload to Azure press the second button and chose “Publish as Azure Webjob” and follow the instructions.
You might want to take advantage of the Azure management UI by downloading a publishing profile from your web application dashboard. You can use this publishing profile in Visual Studio.
The webjobs what they do
This is the one which will be reading the PnPProvisioningJobs list and create jobs to be processed by the other webjobs. You have to have this on to get anything done, mostly related to site provisioning. I might be wrong on some of the details here but having this on is essential.
My understanding is that his job is what is provisioning the sites and creating templates of sites.
Guide – What is where or how things work
The web application overall UI functionality
As is mentioned in this documentation there are several views(pages) which are used with the site provisioning. Notice that not all of them are available through the web application UI and this in my opinion is confusing.
Some of the functionalities are only available in a actual site:
- Creating a new sub site
- This is only available when you go to a site, from “site settings” select “site contents”. The PnP Partner Pack overrides the default “New subsite” link. I kind of understand this but was not the first place where I expected it to be.
- Saving a site template
- This can be found under your site “site settings” in the category “site actions”. There is a JS file which is attached to your PnP sites which add a new link here named as “Save site as Provisioning Template”.
The JS file is located in the infrastructure site in the Library: PnPProvisioningTemplates under the folder: Overrides. Through the XML file in this location the JS file is loaded and the two above mentioned things are performed.
Infrastructural Site Collection
What is mean by this is that this is a “dummy” site collection created by you and then you apply the steps(script) https://github.com/OfficeDev/PnP-Partner-Pack/blob/master/scripts/Provision-InfrastructureSiteArtifacts.ps1 on the site collection. This will be the central hub from where all things are operated from regarding site provisioning.
Good to know libraries
This is where your site provisioning templates are located(right in the root of the library) and all other PnP site provisioning related configuration data.
This is all of the actions(jobs, requests) for sub site, site collection, site templates etc are stored. Based on these the web jobs will start to operate.