web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Creating a site collec...
Power Automate
Answered

Creating a site collection with Power Automate

(0) ShareShare
ReportReport
Posted on by 206

I've seen this question asked before, but the answers posted always seem incorrect.    For example, in the article below, the user asks how to create a site collection but the proposed solution creates a SUBSITE - in Office 365, there is a HUGE difference:

 

https://powerusers.microsoft.com/t5/General-Power-Automate/Create-Site-Collection/m-p/294258#M28790

 

Most answers I've seen make a similar error or advise using Azure functions to run a Powershell script to provision the site collection.   What I'd like to know is the following:

 

1.  Has anyone triggered a PowerShell script running in an Azure function from Power Automate which provisions a site collection?  Not a subsite - a *site collection.*

2.  Based on what I'm seeing, I don't see a way to create the site collection via Power Automate directly via a REST connection.  Is that true?

3.  Plumsail makes Plumsail Actions and it has a lot of cool activities, including an activity to deploy modern sites - which deploys an actual site collection.  Does anyone have experience with these activities?

Categories:
I have the same question (0)
  • Verified answer
    blanghorst Profile Picture
    206 on at

    I'm going to go ahead and post the proper ( 🙂 ) solution to this question in case anyone asks in the future.  You CAN create a site collection from Flow very easily.    First, an article on creating modern sites with REST:

     

    https://docs.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest

     

    Second, implementation in Power Automate:

    Flow.jpg

     

    This creates a new site collection!  In my example above, I have it triggered from a manual Flow from a list item, but you can trigger it any other way as well.   You can also associate the site with a hub site using an additional REST call - details here:

     

    https://docs.microsoft.com/en-us/sharepoint/dev/features/hub-site/rest-joinhubsite-method

     

    You can deploy a site with any site design in your tenant.  

  • Kamz Profile Picture
    131 on at
    is there a way to package this so that it auto associates with a hub site?
  • blanghorst Profile Picture
    206 on at

    Yes, the second link in my post describes that process.

  • Kamz Profile Picture
    131 on at

    Yes I followed that, however it times out with BadGateway. Basically I have a process in which a site is created based on a list. That portion is fine.

     

    The associating with a hub site is what keeps failing

     

     "parameters": {
     "dataset": "https://domain.sharepoint.com/sites/Test",
     "parameters/method": "POST",
     "parameters/uri": "/_api/site/JoinHubSite('##########')",
     "parameters/headers": {
     "Accept": "application/json;odata=verbose\n",
     "Content-Type": "application/json;odata=verbose;charset=utf-8\n"
     
  • blanghorst Profile Picture
    206 on at

    If you're putting the hub site REST call as the step after the site creation, you should add a delay between the two steps.  I create my site, have a delay activity (I arbitrarily put 5 minutes), and then perform the hub site REST call.  Mine works fine that way.

  • Kamz Profile Picture
    131 on at
    Thank you!
  • PURNA429 Profile Picture
    195 on at

    Thanks @blanghorst .

    Can you confirm that, the user/flow connection needs SharePoint admin/ Global Admin rights on tenant right.?

    Can this be done by a regular user with his permissions elevation like RunWithElevatedPrivileges in Server Object Model and app-only permission in Provider Hosted model in On-premise environment.

     

    Thanks

    Purna

  • blanghorst Profile Picture
    206 on at

    I haven't tested it with a standard user because I ended up not needing it.  However, my guess is that if site creation is enabled for users (which I believe is the default), this would likely work for a standard user.  You could also potentially run the creation steps in the flow using an account which does have the proper permissions.

  • PURNA429 Profile Picture
    195 on at

    Thank you @blanghorst  for quick response.   I will give a test on my end.

     

    Regards

    Purna

  • Abhishek4 Profile Picture
    2 on at

    Any idea, if we can set external sharing using the same way?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard