Forum Discussion
Site provisioning from SharePoint (online) UI - CSOM, REST, Azure? What is the best approach?
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.
- Apr 01, 2017+1 for Azure functions approach suggested by Bill
- DeletedApr 02, 2017
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 SvensonApr 02, 2017Steel Contributor
Deleted wrote: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.
Indeed, and for functions the connection has to stay open during the duration. Spinning up old style site collection still usually takes 10+ minutes, so an always on webjob or similar might be a more stable approach.
For my sample, polling the site order list works fine, and we have it in production. But if you create many sites right away, the last person is in for a white as it does things synchronously. Which means, you need to look at the scenario at hand, and architect the complexity needed to solve your scenario. How many moving parts do you need to make it work for you?