Issue: This is similar to Issue 631
When a group is created using Microsoft Graph, the Group Site remains pending for hours unless a user browses to the site.
This means that if you create a site with PNP Powershell, REST, or a Graph Managed API, operations on the site such as provisioning lists, adding users, etc., cannot occur.
The mentioned recommendation is to use Microsoft Graph; however, Microsoft Graph exhibits the same behavior.
We need a way to create a site and make it immediately available as is the behavior when creating from the new built in self-service site creation feature.
Yes, same issue with me.
There are some limitation of group creation via MS Graph API for me.
And the SharePoint REST create group site immediately, but the group mailbox cannot be created immediately.
So I used EWS to do it. You can contact me([email protected]) if you want to the demo code.
I'm having the same issue as well.
For me it appears to be related to the fact that I'm using app-only context when running the MS Graph queries. When doing the Drive query (https://graph.microsoft.com/v1.0/groups/{groupId}/drive/) using the Graph Explorer, the site is provisoned within 10-20 seconds. After that, my own app-only code is also able to obtain the Group's Drive information using the endpoint above.
Unfortunately having user context is not really an option when the code has to be running inside Azure Functions as a scheduled task.
Just encountered similar issue. Provisioned Group using app-only context and SharePoint site was missing. After two hours ran GET query to to Groups drive and site was provisioned.
In the end, the only way I could figure to make this work was to use a timer triggered azure function to wait for site creation. After a user browses to the site, then the site is created and a function provisions the new site.
If you have a user context, then this is all academic. You can also use Easy Auth with a function; however, that is less than perfect.
In the last couple of months, creating a group generated the corresponding sitecollection instantly. Since 2 weeks or so, it stopped working again. The group is created, but the sitecollection is not. When browsing to files in the group, the sitecollection is generated in a couple of seconds, and the user will be redirected to the sitecollection.
We create the group with an app-only context, on behalve of the user, so we can do provisioning also in the generated sitecollection.
Any thoughts or directions on this? We need the sitecollection to continue provisioning.
Microsoft's statement is that creating a group and sitecollection trough app-only context is a supported scenario: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly
Creating modern team sites does not support app-only when you use the SharePoint API for it. When modern team sites are created using Microsoft Graph to create the group then app-only is a supported scenario
SPO site is created when specifying Owners for the O365 Group. See examples from #2998 (v1 endpoint) and #3034 (beta endpoint) that are now merged into master branch.
Most helpful comment
I'm having the same issue as well.
For me it appears to be related to the fact that I'm using app-only context when running the MS Graph queries. When doing the Drive query (https://graph.microsoft.com/v1.0/groups/{groupId}/drive/) using the Graph Explorer, the site is provisoned within 10-20 seconds. After that, my own app-only code is also able to obtain the Group's Drive information using the endpoint above.
Unfortunately having user context is not really an option when the code has to be running inside Azure Functions as a scheduled task.