Forum Discussion
Site provisioning from SharePoint (online) UI - CSOM, REST, Azure? What is the best approach?
We have a kind of case-filing application in SharePoint. When we have a new case, a new site has to be genereated (specific webparts, settings and content).
We developed a (CSOM) C# windows.exe application to create these sites. For the time being this was an acceptable solution. Now we want to integrate this site provisioning more in the SharePoint user experience.
We did a proof of concept with the REST API and javascript. This failed as we did not manage to set all settings of the webparts.
Now we are thing about rebuilding our provisioning tool on the azure platform and integrate this in the Sharepoint solution.
We do not have any experience using Azure, so before investing a lot of time in our nex proof of concept, I would just like to check if this can be a succesful approach. Or is there another solution possible we did not think of?
Thanks, Mike
9 Replies
Site provisioning is not a good candidate for the client-side approach. It really needs to happen asynchronously on a server somewhere. There are many ways of achieving this, and Azure has a number of options for running code in the background, including Azure Functions which avoid the need to commit to a server running continuously. I would look for sample code from PnP Provisioning as suggested and host in Azure by one means or another.
- +1 for Azure functions approach suggested by Bill
- Anonymous
I think a part is right Bill_Ayers1 jcgonzalezmartin but if you use functions be carefull when you have a large site to provision the function will have a time out.
- Mikael SvensonIron ContributorHi, see this powershell sample I did: https://github.com/SharePoint/PnP-PowerShell/tree/dev/Samples/Provisioning.SelfHostedWithAzureWebJob
You could easily do this with C#, or create a UI on the list - or have some UI trigger a webjob. Many possibilities :)
Or look at the PnP partner pack solution.- Anonymous
Mike Jansen i would defenitly advice to use PNP and C# combo where you can use a webjob with a message quee in Azure.. using a event receiver or webhook to trigger the action in SharePoint.