Forum Discussion
How to create modern sites with code via app-only or any other mechanism.
you can use Graph API and create an O365 Group
https://docs.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0 Application is supported, with Group.ReadWrite.All permission on your Azure Active Directory Application
Here you can find the reference https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/modern-experience-customizations-provisioning-sites
I suggest to you to use graph directly, because of TeamSiteCollectionCreationInformation and PnP CSOM Core component in my experience has some bugs, but feel free to use, maybe in your case it works good :)
Cheers,
Federico
- Luis ValenciaApr 18, 2019Copper ContributorThanks Federico, but I dont want to create groups, I want to create modern sites without groups.
- Vivek_BhedaMay 07, 2020Copper Contributor
Luis Valencia : You can create team sites without group using app-only context, please find below links, that may be useful for you :
https://sharepoint.uservoice.com/forums/329220-sharepoint-dev-platform/suggestions/34236700-ability-to-use-app-only-calls-to-create-modern-sit
https://docs.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest
- Luis ValenciaMay 02, 2019Copper Contributor
Would love that somebody from Microsoft can tell us something here.