Forum Discussion
Oliver Zeiser
Oct 17, 2016Brass Contributor
SharePoint Online issues creating site collections via PnP code again...
We are seeing issues when creating new sites via the PnP Core extension method AddSiteCollection. We are seeing this on several customer tenants. Can someone confirm that this is once again a SPO is...
Oliver Zeiser
Feb 08, 2017Brass Contributor
This is very specific to our solution, so i can't simply share the code. But the best Workaround right now would be to upgrade to the latest PnP Nuget Package. If you do this, it will just work, unless you need the site ID for some reason.
The problem is related to getting the site ID from the tenant object. Within the latest PnP core there is a try catch and it will return a Guid.Empty in case this error occures. If you don't care about the site id, everything is fine. Otherwise you would continue from there and get the site guid yourself.
The problem is related to getting the site ID from the tenant object. Within the latest PnP core there is a try catch and it will return a Guid.Empty in case this error occures. If you don't care about the site id, everything is fine. Otherwise you would continue from there and get the site guid yourself.
Venkata Ratnam Vemula
Feb 11, 2017Brass Contributor
Thanks Oliver. I have upgraded to latest PnP version and used the timeout function in CreateSiteCollection method, after which it started working fine. I am sharing the logic here hoping it will help someone.
tenant.CreateSiteCollection(newSite, true, true, timeoutFunction: (operationMessage) =>
{
if (operationMessage == TenantOperationMessage.CreatingSiteCollection)
{
//Log a message saying Site collection is still in progress
}
return false;
});