Automated Site Collection Provisioning
In this post, I would like to talk about automated site collection and teams (Microsoft Teams) provisioning in Microsoft 365. We had to provide Self-Service site and team creation for one of the clients instead of depending on Admins and at the same time without compromising governance. For this reason, we have added Admin approval step in Power Automate. The SharePoint site also should be created with custom template.
We have developed a Governed Self-Service Site Creation solution. The process is as follows. I have inspired this process from the MS Doc article.
- We have created a hub site to group/organize all the sites requested by specific group/department.
- Custom List is used to drive user requests for a new site and it is maintained in hub site.
- Invoke Power Automate for approval by admin before creating a site.
- Power Automate Process
- Admin Approval
- Call Azure Function to initiate provisioning
- Create a Site Template using PnP provisioning engine. The following articles explains the easier way to create site template.
- https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-tenant-templates
- https://www.erwinmcm.com/getting-started-with-the-pnp-provisioning-engine-and-pnp-powershell/
- Create a Tenant Template to provision teams in Microsoft Teams using PnP provisioning engine.
- Setup Daemon app in Azure Active Directory to provision resources as the Azure function executes the scripts using application identity instead of user identity. Daemon app needs following permissions to provision Site and Teams.
- Create a Hub site.
- Create a List to handle user requests.
- Create a Power Automate to trigger when an item added in the above list.
- Approval request will be sent to Admin. If Admin approves, then approval confirmation email sent to requestor and SharePoint list item status changed to "Provisioning". Otherwise, rejection email will be sent to requestor and the status changed to "Rejected".
- After updating status, we have initiated few variables to invoke azure function.
- We have created three Http trigger Azure Function to perform complete provisioning process. First one is for Create Site, second one is to apply Site Template and third one is for teamify the newly created site.
- If all activities successfully completed then success notification otherwise failure notification will be sent to the requestor.
- We have followed following article to create azure functions as we have used PnP PowerShell commands to do all activities.

|
Field Name |
Field Type |
Comments |
|
Site Title |
Single line of text |
|
|
Site Name |
Single line of text |
|
|
Purpose |
Multiple lines of text |
|
|
Site Owners |
Person or Group |
|
|
Site Members |
Person or Group |
|
|
Request Status |
Choice |
Pending Approval, Provisioning, Rejected, Completed |
https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-pnp-provisioning#create-the-azure-function







Comments
Post a Comment