SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Automated Site
Provisioning
Site Designs
Provisioning Templates
PnP-PowerShell
Flow
Azure Functions
AboutTom Castiglia…
SharePoint / Office 365
Consultant
SharePoint
Saturday Speaker
President of the
San Diego
SharePoint User
Group
Nintex vTE
(virtualTechnical
Evangelist)
@TomCastiglia
linkedin.com/in/tomcastiglia
slideshare.net/tomcastiglia
tom@docfluix.com
meetup.com/SoCalO365/
https://docfluix.com
Agenda – Modern Site Provisioning
Demos
Component
Overview
Tips &Tricks
Component Overview
PnP-
Powershell
• Site Scripts /
Site Designs
• Provisioning
Templates
Microsoft Flow
• HttpTrigger
• Azure
Queues
Connector
Azure
• Storage
Queues
• Functions
Pre-Requisites
• This session assumes you have some basic knowledge of…
• PnP Powershell
• Microsoft Flow
• Azure
• Functions
• Storage Queues
Approaches
Ungoverned
Self-Service
Site
Creation
Governed /
Admin-Only
Site
Creation
Governed
Self-Service
Site
Creation
Ungoverned Self-Service Site Creation
• Users can create sites through the Create
Site button on SharePoint home page
• Optionally select a custom site design
which may or may not invoke
provisioning templates.
• Makes it easy for users to select custom
designs and template
• Allows site sprawl due to lack of
governance
Governed / Admin-Only Site creation
• Same model as self-service, but the Create Site button is not available
in SharePoint home page.
• Admins must create new sites through Powershell or through
SharePoint Admin Center.
• Otherwise, user experience for admins is identical to normal self-
service Create Site
Governed Self-Service Site Creation
• Create Site button is disabled in SharePoint home
• Custom List is used to drive user requests for a new site
• Invoke Flow for approval by admin before creating a site
• Flow Process
• Approval
• Add Message to Azure Storage Queue
• Initiates
Using Site Design to Invoke ProvisioningTemplates
• Site Designs can be used for…
• Create a new SharePoint list
• Define a new site column
• Define a new content type
• Add a navigation link
• Remove a navigation link
• Apply a theme
• Set a site logo
• Join a hub site
• Install an add-in or solution
• Register an extension
• Trigger a flow
• Configure regional settings
• Add users (principals) to SharePoint Groups
• Manage guest access
Site Designs can’t do everything…
Cannot configure pages and web parts
Cannot self-generate from an existing site
Limited to 30 actions / sub-actions
Build Provisioning Solution
• Setup App-Only Access (Register AppId & AppSecret)
• Create Azure Storage Queue
• Create Flow
• Trigger: When HTTP Request is received
• Action: Azure - Put Message on a queue
• Get Provisioning template
• Get-PnPProvisioningTemplate –out “IA-Template.pnp"
-Handlers "Fields,ContentTypes,Lists,SiteSecurity"
-IncludeSiteGroups
• Get-PnPProvisioningTemplate -out "Pages-Template.pnp"
-Handlers "Pages,PageContents,Navigation"
Build Provisioning Solution (Con’t)
• Create Azure Function
• Powershell Queue Trigger
• Connect-PnPOnline -AppId $env:SPO_AppId -
AppSecret $env:SPO_AppSecret -Url $url -
ErrorAction Stop
• Apply-PnPProvisioningTemplate -Path
$templatePath -Handlers SiteSecurity -
ErrorAction Stop
• Upload PnP Powershell Module to Azure
• Save-Module -Name SharePointPnPPowerShellOnline -Path
[pathtoyourfolder]
• Create Site Design
• Include triggerFlow action to send Http Request to Flow
Provisioning Process
Basic Flow Configuration
Azure Function - Powershell
JSON Input Message from Queue
{
"SiteUrl": "[your new site’s url]",
"TemplateToApply": "Your-Template.pnp",
"Description": “[optional description]",
"TemplateType":"Fields"
}
Example ProjectTeam Site
• 10 custom site columns
• 15 custom content types (9 of which have custom templates)
Columns & ContentTypes
• 4 Document Libraries and 1 Picture library
• 3 of these libraries use 12 of the content types and all 10 columns
• About 100 standard documents deployed across three libraries (created via Flow rather after PnP
Provisioning)
• One library has unique permissions
• One library is used to store templates referenced by content types
• MultipleViews
Libraries
• One Highlighted Content web part
• One Library web part
• Planner web part
• Left Navigation
Custom homepage
Tip #1
Application Settings in Azure Functions
• Same concept as AppSettings in web.config or app.config
• Configurable through Azure Functions administration
Don’t name application settings with a name
containing “Temp” or “Tmp”
• Azure will return the setting value as: D:localcopy
(regardless of the value that you store in the setting)
Tip #2
PnP Powershell - New-PnPSite…
•this cannot authenticate using App
Permissions.
•Requires auth via username and
password (limitation in underlying
SharePoint APIs)
Tip #3
Consider storing provisioning templates
in a document library, and reference
from Azure Functions Powershell
Optionally, you can upload to Azure
Functions (but library makes updating
templates easier)
Tip #3 (Con’t)
When calling Apply-PnPPowershell
•If -Path param references a library
instead of a local file (local to
Azure),
•then template must be in “PnP”
format instead of “Xml”.
Tip #4
Create modular Provisioning Templates
• If you execute this command:
• Get-PnPProvisioningTemplate -out “MyTemplate.xml"
• It will create a giant template with every aspect of the site
• Instead create component templates, using Handlers like this
• Get-PnPProvisioningTemplate -out “IA-Template.xml“ –Handlers
“Fields,ContentTypes,Lists,SiteSecurity”
• Get-PnPProvisioningTemplate -out “Pages-Template.xml“ –Handlers
“Pages,PageContents,Navigation”
• Also, use Handlers when applying a template:
• Apply-PnPProvisioningTemplate -Path $templatePath -Handlers
SiteSecurity -ErrorAction Stop
PnP Provisioning Handlers
AuditSettings = 1,
ComposedLook = 2,
CustomActions = 4,
ExtensibilityProviders = 8,
Features = 16,
Fields = 32,
Files = 64,
Lists = 128,
Pages = 256,
Publishing = 512,
RegionalSettings = 1024,
SearchSettings = 2048,
SitePolicy = 4096,
SupportedUILanguages = 8192,
TermGroups = 16384,
Workflows = 32768,
SiteSecurity = 65536,
ContentTypes = 131072,
PropertyBagEntries = 262144,
PageContents = 524288,
WebSettings = 1048576,
Navigation = 2097152,
ImageRenditions = 4194304,
ApplicationLifecycleManagement = 8388608,
Tenant = 16777216,
WebApiPermissions = 33554432,
Tip #5
• With Azure Functions, if using “Consumption Plan” instead of “App Service
Plan”, each function call has a default timeout of 5 minutes (Which can be
increased to 10 minutes max).
• Apply-PnPProvisioningTemplate –Path “[pnp file url]”
• A single large provisioning template can take more than 10 minutes
• Example –
• “IA-Template.pnp” contains Fields, ContentTypes, Lists, SiteSecurity (took 8 – 15
minutes on average)
• Site contains 12 content types, each of which are used in multiple libraries
• Split IA-Template into four templates (Fields.pnp, ContentTypes.pnp, Lists.pnp &
SiteSecurity.pnp)
• Lists.pnp alone would occasionally timeout
• Split Lists.pnp into three templates each one taking only 1 – 3 minutes (but 7
templates total).
• Chained separate function calls for each template
Tip #6
• Having 7 templates is much too granular.
• Many dependencies between templates. Every change to a site requires
tremendous regression testing.
• Switched Function App from Consumption Plan to App Service plan so
that we could have longer time outs.
• Consolidated into 1 template with: SiteSecurity, Fields,
ContentTypes, Lists, Pages, PageContents, Navigation
Tip #7
• You may wish to tweak a provisioning template after it is exported.
• Export to XML (instead of PnP)
• PnP is a zip file so you can rename the extension and review the contents
• Don’t assume that template created from Get-PnPProvisioningTemplate
will be perfect. Plan to tweak the exported Xml.
• Although you can create the provisioning template from scratch on your
own, you can use Get-PnPProvisioningTemplate to create examples and
snippets that you can use in manually generated templates
• Make your edits, then convert to PnP format:
$template = Read-PnPProvisioningTemplate -Path .MyTemplate.xml
Save-PnPProvisioningTemplate -InputInstance $template -Out .MyTemplate.pnp
Tip #8
•Problem - Occasional Race conditions
•When using Apply-PnPProvisioningTemplate with a
single template, I occasionally encountered
unexplained errors:
• Invalid Field Name (When adding a Field to a Content
Type)
• The specified user Site Owners could not be found.
(When configuring unique permissions on library)
•Running same template on same site again and it
would work without error.
Tip #8 (Con’t)
Solution –
• In Flow, Added 120 sec delay after site
was created before placing item on
queue
• Seemed to help but still saw occasional
errors
• Modified Powershell to make multiple
calls to Apply-PnPProvisioningTemplate
with different Handlers, such as:
Apply-PnPProvisioningTemplate
-Path $templatePath
-Handlers SiteSecurity
-ErrorAction Stop
Start-Sleep -s 60
Apply-PnPProvisioningTemplate
-Path $templatePath
-Handlers Fields
-ErrorAction Stop
Start-Sleep -s 60
…
Tip #9
• For Error Handling (try/catch) need to specify:
• ErrorAction –Stop
• like this…
try {
Apply-PnPProvisioningTemplate -Path $templatePath -ErrorAction Stop
}
catch {
Write-Output “Error: $($_.Exception.GetType().FullName)”
Write-Output “Msg: $($_.Exception.Message)”
}
Otherwise exceptions from Apply-PnPProvisioningTemplate
won’t hit your catch
Tip #10 - Leverage ProvisioningTokens
Token Names (small sample) Return value
{siteid} Returns id of the current site
{sitename} Returns friendly name of the site
(example: I placed this token directly as the default value
for a “ProjectName” site column, where each site’s name
reflects the project name.)
{sitecollection} Returns Server relative Url of the site collection
{fieldtitle:[internalname]} Returns title of field by internal name (used when dealing
with calculated columns)
{listid:[name]} Returns a id of the list given its name
{listurl:[name]} Returns a site relative url of the list given its name
{associatedmembersgroup}
{associatedownersgroup}
{associatedvisitorsgroup}
Returns the title of the associated
member/owners/visitors SharePoint group of a site
{sitecollectiontermsetid:[termsetname]} Returns the id of the given termset name located in the
sitecollection termgroup
OtherTips
• Although PnP Provisioning allows us to store default content (e.g.
documents, metadata, list items in a template, we decided not to do
that).
• We are using a Hub site to store standard documents in various
libraries.
• Use MS Flow to
• Copy documents and metadata to each new site
• Create Buckets and Tasks in Planner that are defined in lists in the Hub site
• This approach allows power users to easily change the default content
and Planner items
Resources
• Provisioing Tokens:
• https://github.com/SharePoint/PnP-Sites-
Core/blob/master/Core/ProvisioningEngineTokens.md
• Overall solution:
• https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-
design-pnp-provisioning

Weitere ähnliche Inhalte

Was ist angesagt?

Conceitos básicos de programação orientada a objetos
Conceitos básicos de programação orientada a objetosConceitos básicos de programação orientada a objetos
Conceitos básicos de programação orientada a objetosLeonardo Melo Santos
 
SharePoint Document Management
SharePoint Document ManagementSharePoint Document Management
SharePoint Document ManagementMJ Ferdous
 
Getting Started with Informatica
Getting Started with InformaticaGetting Started with Informatica
Getting Started with InformaticaEdureka!
 
Object oriented programming dengan php
Object oriented programming dengan phpObject oriented programming dengan php
Object oriented programming dengan phpMateri Kuliah Online
 
Enteprise Integration Patterns
Enteprise Integration PatternsEnteprise Integration Patterns
Enteprise Integration PatternsAlessandro Kieras
 
RPS 2022-Pemrograman Web 2.pdf
RPS 2022-Pemrograman Web 2.pdfRPS 2022-Pemrograman Web 2.pdf
RPS 2022-Pemrograman Web 2.pdfSetiya Nugroho
 
Provisioning SPFx Solutions to SharePoint Online using PnP, ALM APIs and more!
Provisioning SPFx Solutions to SharePoint Online using PnP, ALM APIs and more!Provisioning SPFx Solutions to SharePoint Online using PnP, ALM APIs and more!
Provisioning SPFx Solutions to SharePoint Online using PnP, ALM APIs and more!Rencore
 
Data Management (Database Environment)
Data Management (Database Environment)Data Management (Database Environment)
Data Management (Database Environment)Adam Mukharil Bachtiar
 
Programação Orientada a Objetos
Programação Orientada a ObjetosProgramação Orientada a Objetos
Programação Orientada a ObjetosIgor Takenami
 
Pertemuan 1 konsep dasar pemrograman berorientasi objek
Pertemuan 1 konsep dasar pemrograman berorientasi objekPertemuan 1 konsep dasar pemrograman berorientasi objek
Pertemuan 1 konsep dasar pemrograman berorientasi objekI Putu Arya Dharmaadi
 
Pemodelan perangkat lunak
Pemodelan perangkat lunakPemodelan perangkat lunak
Pemodelan perangkat lunakAdityaSaputra83
 
Data Management (Basis Data Berbasis Dokumen)
Data Management (Basis Data Berbasis Dokumen)Data Management (Basis Data Berbasis Dokumen)
Data Management (Basis Data Berbasis Dokumen)Adam Mukharil Bachtiar
 
4. tools proyek data science dts ta v.2
4. tools proyek data science dts ta v.24. tools proyek data science dts ta v.2
4. tools proyek data science dts ta v.2ArdianDwiPraba
 
Controller dalam Laravel (Pemrograman Web II)
Controller dalam Laravel (Pemrograman Web II)Controller dalam Laravel (Pemrograman Web II)
Controller dalam Laravel (Pemrograman Web II)I Gede Iwan Sudipa
 
OneDrive & SharePoint Better Together
OneDrive & SharePoint Better TogetherOneDrive & SharePoint Better Together
OneDrive & SharePoint Better TogetherDrew Madelung
 
Algoritma dan Struktur Data - Selection Sort
Algoritma dan Struktur Data - Selection SortAlgoritma dan Struktur Data - Selection Sort
Algoritma dan Struktur Data - Selection SortKuliahKita
 
Contoh web statis, dinamis, dan interaktif
Contoh web statis, dinamis, dan interaktifContoh web statis, dinamis, dan interaktif
Contoh web statis, dinamis, dan interaktifTaufan Adriansyah
 

Was ist angesagt? (20)

Keamanan sistem operasi
Keamanan sistem operasiKeamanan sistem operasi
Keamanan sistem operasi
 
Conceitos básicos de programação orientada a objetos
Conceitos básicos de programação orientada a objetosConceitos básicos de programação orientada a objetos
Conceitos básicos de programação orientada a objetos
 
SharePoint Document Management
SharePoint Document ManagementSharePoint Document Management
SharePoint Document Management
 
Getting Started with Informatica
Getting Started with InformaticaGetting Started with Informatica
Getting Started with Informatica
 
Object oriented programming dengan php
Object oriented programming dengan phpObject oriented programming dengan php
Object oriented programming dengan php
 
Enteprise Integration Patterns
Enteprise Integration PatternsEnteprise Integration Patterns
Enteprise Integration Patterns
 
RPS 2022-Pemrograman Web 2.pdf
RPS 2022-Pemrograman Web 2.pdfRPS 2022-Pemrograman Web 2.pdf
RPS 2022-Pemrograman Web 2.pdf
 
Provisioning SPFx Solutions to SharePoint Online using PnP, ALM APIs and more!
Provisioning SPFx Solutions to SharePoint Online using PnP, ALM APIs and more!Provisioning SPFx Solutions to SharePoint Online using PnP, ALM APIs and more!
Provisioning SPFx Solutions to SharePoint Online using PnP, ALM APIs and more!
 
Data Management (Database Environment)
Data Management (Database Environment)Data Management (Database Environment)
Data Management (Database Environment)
 
Programação Orientada a Objetos
Programação Orientada a ObjetosProgramação Orientada a Objetos
Programação Orientada a Objetos
 
Tic modulo-25
Tic modulo-25Tic modulo-25
Tic modulo-25
 
Pertemuan 1 konsep dasar pemrograman berorientasi objek
Pertemuan 1 konsep dasar pemrograman berorientasi objekPertemuan 1 konsep dasar pemrograman berorientasi objek
Pertemuan 1 konsep dasar pemrograman berorientasi objek
 
Pemodelan perangkat lunak
Pemodelan perangkat lunakPemodelan perangkat lunak
Pemodelan perangkat lunak
 
Data Management (Basis Data Berbasis Dokumen)
Data Management (Basis Data Berbasis Dokumen)Data Management (Basis Data Berbasis Dokumen)
Data Management (Basis Data Berbasis Dokumen)
 
4. tools proyek data science dts ta v.2
4. tools proyek data science dts ta v.24. tools proyek data science dts ta v.2
4. tools proyek data science dts ta v.2
 
Controller dalam Laravel (Pemrograman Web II)
Controller dalam Laravel (Pemrograman Web II)Controller dalam Laravel (Pemrograman Web II)
Controller dalam Laravel (Pemrograman Web II)
 
OneDrive & SharePoint Better Together
OneDrive & SharePoint Better TogetherOneDrive & SharePoint Better Together
OneDrive & SharePoint Better Together
 
Algoritma dan Struktur Data - Selection Sort
Algoritma dan Struktur Data - Selection SortAlgoritma dan Struktur Data - Selection Sort
Algoritma dan Struktur Data - Selection Sort
 
Contoh web statis, dinamis, dan interaktif
Contoh web statis, dinamis, dan interaktifContoh web statis, dinamis, dan interaktif
Contoh web statis, dinamis, dan interaktif
 
SharePoint 2016 Overview
SharePoint 2016 OverviewSharePoint 2016 Overview
SharePoint 2016 Overview
 

Ähnlich wie Modern Automated Site Provisioning for SharePoint Online

Azure Automation, PnP Provisioning and PnP PowerShell
Azure Automation, PnP Provisioning and PnP PowerShellAzure Automation, PnP Provisioning and PnP PowerShell
Azure Automation, PnP Provisioning and PnP PowerShellMarkus Moeller
 
How to automate the SharePoint Provisioning
How to automate the SharePoint Provisioning How to automate the SharePoint Provisioning
How to automate the SharePoint Provisioning Knut Relbe-Moe [MVP, MCT]
 
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UICross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UIThomas Daly
 
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...Eric Overfield
 
10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps FasterBrij Mishra
 
Learn from my Mistakes - Building Better Solutions in SPFx
Learn from my  Mistakes - Building Better Solutions in SPFxLearn from my  Mistakes - Building Better Solutions in SPFx
Learn from my Mistakes - Building Better Solutions in SPFxThomas Daly
 
Azure Functions @ global azure day 2017
Azure Functions  @ global azure day 2017Azure Functions  @ global azure day 2017
Azure Functions @ global azure day 2017Sean Feldman
 
Ei cakephp
Ei cakephpEi cakephp
Ei cakephpeiei lay
 
O365Engage17 - How to Automate SharePoint Provisioning with PNP Framework
O365Engage17 - How to Automate SharePoint Provisioning with PNP FrameworkO365Engage17 - How to Automate SharePoint Provisioning with PNP Framework
O365Engage17 - How to Automate SharePoint Provisioning with PNP FrameworkNCCOMMS
 
SplunkLive! Advanced Session
SplunkLive! Advanced SessionSplunkLive! Advanced Session
SplunkLive! Advanced SessionSplunk
 
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...SPS Paris
 
Cross Site Collection Navigation using SPFx, Powershell PnP & PnP-JS
Cross Site Collection Navigation using SPFx, Powershell PnP & PnP-JSCross Site Collection Navigation using SPFx, Powershell PnP & PnP-JS
Cross Site Collection Navigation using SPFx, Powershell PnP & PnP-JSThomas Daly
 
Updating Legacy SharePoint Customizations to the Add-in Model
Updating Legacy SharePoint Customizations to the Add-in ModelUpdating Legacy SharePoint Customizations to the Add-in Model
Updating Legacy SharePoint Customizations to the Add-in ModelDanny Jessee
 
Cypress report
Cypress reportCypress report
Cypress reportAdarsh
 
Cross Site Collection Navigation
Cross Site Collection NavigationCross Site Collection Navigation
Cross Site Collection NavigationThomas Daly
 
Intro to CakePHP 1.3
Intro to CakePHP 1.3Intro to CakePHP 1.3
Intro to CakePHP 1.3Adam Culp
 
Mastering Office 365 with PowerShell - TechDays Finland 2020
Mastering Office 365 with PowerShell -  TechDays Finland 2020Mastering Office 365 with PowerShell -  TechDays Finland 2020
Mastering Office 365 with PowerShell - TechDays Finland 2020Matti Paukkonen [MVP]
 

Ähnlich wie Modern Automated Site Provisioning for SharePoint Online (20)

Azure Automation, PnP Provisioning and PnP PowerShell
Azure Automation, PnP Provisioning and PnP PowerShellAzure Automation, PnP Provisioning and PnP PowerShell
Azure Automation, PnP Provisioning and PnP PowerShell
 
How to automate the SharePoint Provisioning
How to automate the SharePoint Provisioning How to automate the SharePoint Provisioning
How to automate the SharePoint Provisioning
 
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UICross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
 
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
 
10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster
 
Learn from my Mistakes - Building Better Solutions in SPFx
Learn from my  Mistakes - Building Better Solutions in SPFxLearn from my  Mistakes - Building Better Solutions in SPFx
Learn from my Mistakes - Building Better Solutions in SPFx
 
Azure Functions @ global azure day 2017
Azure Functions  @ global azure day 2017Azure Functions  @ global azure day 2017
Azure Functions @ global azure day 2017
 
Ei cakephp
Ei cakephpEi cakephp
Ei cakephp
 
Cakeph pppt
Cakeph ppptCakeph pppt
Cakeph pppt
 
O365Engage17 - How to Automate SharePoint Provisioning with PNP Framework
O365Engage17 - How to Automate SharePoint Provisioning with PNP FrameworkO365Engage17 - How to Automate SharePoint Provisioning with PNP Framework
O365Engage17 - How to Automate SharePoint Provisioning with PNP Framework
 
SplunkLive! Advanced Session
SplunkLive! Advanced SessionSplunkLive! Advanced Session
SplunkLive! Advanced Session
 
[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions
 
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
D2 - Automate Custom Solutions Deployment on Office 365 and Azure - Paolo Pia...
 
Cross Site Collection Navigation using SPFx, Powershell PnP & PnP-JS
Cross Site Collection Navigation using SPFx, Powershell PnP & PnP-JSCross Site Collection Navigation using SPFx, Powershell PnP & PnP-JS
Cross Site Collection Navigation using SPFx, Powershell PnP & PnP-JS
 
Updating Legacy SharePoint Customizations to the Add-in Model
Updating Legacy SharePoint Customizations to the Add-in ModelUpdating Legacy SharePoint Customizations to the Add-in Model
Updating Legacy SharePoint Customizations to the Add-in Model
 
Cypress report
Cypress reportCypress report
Cypress report
 
Cross Site Collection Navigation
Cross Site Collection NavigationCross Site Collection Navigation
Cross Site Collection Navigation
 
Intro to CakePHP 1.3
Intro to CakePHP 1.3Intro to CakePHP 1.3
Intro to CakePHP 1.3
 
O365: Attack of the Clones
O365: Attack of the ClonesO365: Attack of the Clones
O365: Attack of the Clones
 
Mastering Office 365 with PowerShell - TechDays Finland 2020
Mastering Office 365 with PowerShell -  TechDays Finland 2020Mastering Office 365 with PowerShell -  TechDays Finland 2020
Mastering Office 365 with PowerShell - TechDays Finland 2020
 

Mehr von DocFluix, LLC

IA& Taxonomy Planning for SharePoint Online & Office 365
IA& Taxonomy Planning for SharePoint Online & Office 365IA& Taxonomy Planning for SharePoint Online & Office 365
IA& Taxonomy Planning for SharePoint Online & Office 365DocFluix, LLC
 
Developing Azure Functions for Flow and Nintex SPS SD 2018
Developing Azure Functions for Flow and Nintex SPS SD 2018Developing Azure Functions for Flow and Nintex SPS SD 2018
Developing Azure Functions for Flow and Nintex SPS SD 2018DocFluix, LLC
 
Developing Azure Functions as custom connectors for Flow and Nintex
Developing Azure Functions as custom connectors for Flow and NintexDeveloping Azure Functions as custom connectors for Flow and Nintex
Developing Azure Functions as custom connectors for Flow and NintexDocFluix, LLC
 
Microsoft flow how, when & why
Microsoft flow   how, when & whyMicrosoft flow   how, when & why
Microsoft flow how, when & whyDocFluix, LLC
 
Using Nintex Workflow Cloud with Salesforce for customer surveys
Using Nintex Workflow Cloud with Salesforce for customer surveysUsing Nintex Workflow Cloud with Salesforce for customer surveys
Using Nintex Workflow Cloud with Salesforce for customer surveysDocFluix, LLC
 
Using SharePoint, Nintex & DocuSign for Employee Onboarding and Open Enrollme...
Using SharePoint, Nintex & DocuSign for Employee Onboarding and Open Enrollme...Using SharePoint, Nintex & DocuSign for Employee Onboarding and Open Enrollme...
Using SharePoint, Nintex & DocuSign for Employee Onboarding and Open Enrollme...DocFluix, LLC
 
14 tips for planning a ecm content migration to share point
14 tips for planning a ecm content migration to share point14 tips for planning a ecm content migration to share point
14 tips for planning a ecm content migration to share pointDocFluix, LLC
 
SPS Phoenix Optimizing SharePoint for Transactional Content Management
SPS Phoenix Optimizing SharePoint for Transactional Content ManagementSPS Phoenix Optimizing SharePoint for Transactional Content Management
SPS Phoenix Optimizing SharePoint for Transactional Content ManagementDocFluix, LLC
 
15 tips for bullet proof requirements analysis on SharePoint projects
15 tips for bullet proof requirements analysis on SharePoint projects15 tips for bullet proof requirements analysis on SharePoint projects
15 tips for bullet proof requirements analysis on SharePoint projectsDocFluix, LLC
 
Optimizing SharePoint for Transactional Content Management
Optimizing SharePoint for Transactional Content ManagementOptimizing SharePoint for Transactional Content Management
Optimizing SharePoint for Transactional Content ManagementDocFluix, LLC
 

Mehr von DocFluix, LLC (10)

IA& Taxonomy Planning for SharePoint Online & Office 365
IA& Taxonomy Planning for SharePoint Online & Office 365IA& Taxonomy Planning for SharePoint Online & Office 365
IA& Taxonomy Planning for SharePoint Online & Office 365
 
Developing Azure Functions for Flow and Nintex SPS SD 2018
Developing Azure Functions for Flow and Nintex SPS SD 2018Developing Azure Functions for Flow and Nintex SPS SD 2018
Developing Azure Functions for Flow and Nintex SPS SD 2018
 
Developing Azure Functions as custom connectors for Flow and Nintex
Developing Azure Functions as custom connectors for Flow and NintexDeveloping Azure Functions as custom connectors for Flow and Nintex
Developing Azure Functions as custom connectors for Flow and Nintex
 
Microsoft flow how, when & why
Microsoft flow   how, when & whyMicrosoft flow   how, when & why
Microsoft flow how, when & why
 
Using Nintex Workflow Cloud with Salesforce for customer surveys
Using Nintex Workflow Cloud with Salesforce for customer surveysUsing Nintex Workflow Cloud with Salesforce for customer surveys
Using Nintex Workflow Cloud with Salesforce for customer surveys
 
Using SharePoint, Nintex & DocuSign for Employee Onboarding and Open Enrollme...
Using SharePoint, Nintex & DocuSign for Employee Onboarding and Open Enrollme...Using SharePoint, Nintex & DocuSign for Employee Onboarding and Open Enrollme...
Using SharePoint, Nintex & DocuSign for Employee Onboarding and Open Enrollme...
 
14 tips for planning a ecm content migration to share point
14 tips for planning a ecm content migration to share point14 tips for planning a ecm content migration to share point
14 tips for planning a ecm content migration to share point
 
SPS Phoenix Optimizing SharePoint for Transactional Content Management
SPS Phoenix Optimizing SharePoint for Transactional Content ManagementSPS Phoenix Optimizing SharePoint for Transactional Content Management
SPS Phoenix Optimizing SharePoint for Transactional Content Management
 
15 tips for bullet proof requirements analysis on SharePoint projects
15 tips for bullet proof requirements analysis on SharePoint projects15 tips for bullet proof requirements analysis on SharePoint projects
15 tips for bullet proof requirements analysis on SharePoint projects
 
Optimizing SharePoint for Transactional Content Management
Optimizing SharePoint for Transactional Content ManagementOptimizing SharePoint for Transactional Content Management
Optimizing SharePoint for Transactional Content Management
 

Kürzlich hochgeladen

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Kürzlich hochgeladen (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Modern Automated Site Provisioning for SharePoint Online

  • 1. Automated Site Provisioning Site Designs Provisioning Templates PnP-PowerShell Flow Azure Functions
  • 2. AboutTom Castiglia… SharePoint / Office 365 Consultant SharePoint Saturday Speaker President of the San Diego SharePoint User Group Nintex vTE (virtualTechnical Evangelist) @TomCastiglia linkedin.com/in/tomcastiglia slideshare.net/tomcastiglia tom@docfluix.com meetup.com/SoCalO365/ https://docfluix.com
  • 3. Agenda – Modern Site Provisioning Demos Component Overview Tips &Tricks
  • 4. Component Overview PnP- Powershell • Site Scripts / Site Designs • Provisioning Templates Microsoft Flow • HttpTrigger • Azure Queues Connector Azure • Storage Queues • Functions
  • 5. Pre-Requisites • This session assumes you have some basic knowledge of… • PnP Powershell • Microsoft Flow • Azure • Functions • Storage Queues
  • 7. Ungoverned Self-Service Site Creation • Users can create sites through the Create Site button on SharePoint home page • Optionally select a custom site design which may or may not invoke provisioning templates. • Makes it easy for users to select custom designs and template • Allows site sprawl due to lack of governance
  • 8. Governed / Admin-Only Site creation • Same model as self-service, but the Create Site button is not available in SharePoint home page. • Admins must create new sites through Powershell or through SharePoint Admin Center. • Otherwise, user experience for admins is identical to normal self- service Create Site
  • 9. Governed Self-Service Site Creation • Create Site button is disabled in SharePoint home • Custom List is used to drive user requests for a new site • Invoke Flow for approval by admin before creating a site • Flow Process • Approval • Add Message to Azure Storage Queue • Initiates
  • 10. Using Site Design to Invoke ProvisioningTemplates • Site Designs can be used for… • Create a new SharePoint list • Define a new site column • Define a new content type • Add a navigation link • Remove a navigation link • Apply a theme • Set a site logo • Join a hub site • Install an add-in or solution • Register an extension • Trigger a flow • Configure regional settings • Add users (principals) to SharePoint Groups • Manage guest access
  • 11. Site Designs can’t do everything… Cannot configure pages and web parts Cannot self-generate from an existing site Limited to 30 actions / sub-actions
  • 12. Build Provisioning Solution • Setup App-Only Access (Register AppId & AppSecret) • Create Azure Storage Queue • Create Flow • Trigger: When HTTP Request is received • Action: Azure - Put Message on a queue • Get Provisioning template • Get-PnPProvisioningTemplate –out “IA-Template.pnp" -Handlers "Fields,ContentTypes,Lists,SiteSecurity" -IncludeSiteGroups • Get-PnPProvisioningTemplate -out "Pages-Template.pnp" -Handlers "Pages,PageContents,Navigation"
  • 13. Build Provisioning Solution (Con’t) • Create Azure Function • Powershell Queue Trigger • Connect-PnPOnline -AppId $env:SPO_AppId - AppSecret $env:SPO_AppSecret -Url $url - ErrorAction Stop • Apply-PnPProvisioningTemplate -Path $templatePath -Handlers SiteSecurity - ErrorAction Stop • Upload PnP Powershell Module to Azure • Save-Module -Name SharePointPnPPowerShellOnline -Path [pathtoyourfolder] • Create Site Design • Include triggerFlow action to send Http Request to Flow
  • 16. Azure Function - Powershell JSON Input Message from Queue { "SiteUrl": "[your new site’s url]", "TemplateToApply": "Your-Template.pnp", "Description": “[optional description]", "TemplateType":"Fields" }
  • 17. Example ProjectTeam Site • 10 custom site columns • 15 custom content types (9 of which have custom templates) Columns & ContentTypes • 4 Document Libraries and 1 Picture library • 3 of these libraries use 12 of the content types and all 10 columns • About 100 standard documents deployed across three libraries (created via Flow rather after PnP Provisioning) • One library has unique permissions • One library is used to store templates referenced by content types • MultipleViews Libraries • One Highlighted Content web part • One Library web part • Planner web part • Left Navigation Custom homepage
  • 18. Tip #1 Application Settings in Azure Functions • Same concept as AppSettings in web.config or app.config • Configurable through Azure Functions administration Don’t name application settings with a name containing “Temp” or “Tmp” • Azure will return the setting value as: D:localcopy (regardless of the value that you store in the setting)
  • 19. Tip #2 PnP Powershell - New-PnPSite… •this cannot authenticate using App Permissions. •Requires auth via username and password (limitation in underlying SharePoint APIs)
  • 20. Tip #3 Consider storing provisioning templates in a document library, and reference from Azure Functions Powershell Optionally, you can upload to Azure Functions (but library makes updating templates easier)
  • 21. Tip #3 (Con’t) When calling Apply-PnPPowershell •If -Path param references a library instead of a local file (local to Azure), •then template must be in “PnP” format instead of “Xml”.
  • 22. Tip #4 Create modular Provisioning Templates • If you execute this command: • Get-PnPProvisioningTemplate -out “MyTemplate.xml" • It will create a giant template with every aspect of the site • Instead create component templates, using Handlers like this • Get-PnPProvisioningTemplate -out “IA-Template.xml“ –Handlers “Fields,ContentTypes,Lists,SiteSecurity” • Get-PnPProvisioningTemplate -out “Pages-Template.xml“ –Handlers “Pages,PageContents,Navigation” • Also, use Handlers when applying a template: • Apply-PnPProvisioningTemplate -Path $templatePath -Handlers SiteSecurity -ErrorAction Stop
  • 23. PnP Provisioning Handlers AuditSettings = 1, ComposedLook = 2, CustomActions = 4, ExtensibilityProviders = 8, Features = 16, Fields = 32, Files = 64, Lists = 128, Pages = 256, Publishing = 512, RegionalSettings = 1024, SearchSettings = 2048, SitePolicy = 4096, SupportedUILanguages = 8192, TermGroups = 16384, Workflows = 32768, SiteSecurity = 65536, ContentTypes = 131072, PropertyBagEntries = 262144, PageContents = 524288, WebSettings = 1048576, Navigation = 2097152, ImageRenditions = 4194304, ApplicationLifecycleManagement = 8388608, Tenant = 16777216, WebApiPermissions = 33554432,
  • 24. Tip #5 • With Azure Functions, if using “Consumption Plan” instead of “App Service Plan”, each function call has a default timeout of 5 minutes (Which can be increased to 10 minutes max). • Apply-PnPProvisioningTemplate –Path “[pnp file url]” • A single large provisioning template can take more than 10 minutes • Example – • “IA-Template.pnp” contains Fields, ContentTypes, Lists, SiteSecurity (took 8 – 15 minutes on average) • Site contains 12 content types, each of which are used in multiple libraries • Split IA-Template into four templates (Fields.pnp, ContentTypes.pnp, Lists.pnp & SiteSecurity.pnp) • Lists.pnp alone would occasionally timeout • Split Lists.pnp into three templates each one taking only 1 – 3 minutes (but 7 templates total). • Chained separate function calls for each template
  • 25. Tip #6 • Having 7 templates is much too granular. • Many dependencies between templates. Every change to a site requires tremendous regression testing. • Switched Function App from Consumption Plan to App Service plan so that we could have longer time outs. • Consolidated into 1 template with: SiteSecurity, Fields, ContentTypes, Lists, Pages, PageContents, Navigation
  • 26. Tip #7 • You may wish to tweak a provisioning template after it is exported. • Export to XML (instead of PnP) • PnP is a zip file so you can rename the extension and review the contents • Don’t assume that template created from Get-PnPProvisioningTemplate will be perfect. Plan to tweak the exported Xml. • Although you can create the provisioning template from scratch on your own, you can use Get-PnPProvisioningTemplate to create examples and snippets that you can use in manually generated templates • Make your edits, then convert to PnP format: $template = Read-PnPProvisioningTemplate -Path .MyTemplate.xml Save-PnPProvisioningTemplate -InputInstance $template -Out .MyTemplate.pnp
  • 27. Tip #8 •Problem - Occasional Race conditions •When using Apply-PnPProvisioningTemplate with a single template, I occasionally encountered unexplained errors: • Invalid Field Name (When adding a Field to a Content Type) • The specified user Site Owners could not be found. (When configuring unique permissions on library) •Running same template on same site again and it would work without error.
  • 28. Tip #8 (Con’t) Solution – • In Flow, Added 120 sec delay after site was created before placing item on queue • Seemed to help but still saw occasional errors • Modified Powershell to make multiple calls to Apply-PnPProvisioningTemplate with different Handlers, such as: Apply-PnPProvisioningTemplate -Path $templatePath -Handlers SiteSecurity -ErrorAction Stop Start-Sleep -s 60 Apply-PnPProvisioningTemplate -Path $templatePath -Handlers Fields -ErrorAction Stop Start-Sleep -s 60 …
  • 29. Tip #9 • For Error Handling (try/catch) need to specify: • ErrorAction –Stop • like this… try { Apply-PnPProvisioningTemplate -Path $templatePath -ErrorAction Stop } catch { Write-Output “Error: $($_.Exception.GetType().FullName)” Write-Output “Msg: $($_.Exception.Message)” } Otherwise exceptions from Apply-PnPProvisioningTemplate won’t hit your catch
  • 30. Tip #10 - Leverage ProvisioningTokens Token Names (small sample) Return value {siteid} Returns id of the current site {sitename} Returns friendly name of the site (example: I placed this token directly as the default value for a “ProjectName” site column, where each site’s name reflects the project name.) {sitecollection} Returns Server relative Url of the site collection {fieldtitle:[internalname]} Returns title of field by internal name (used when dealing with calculated columns) {listid:[name]} Returns a id of the list given its name {listurl:[name]} Returns a site relative url of the list given its name {associatedmembersgroup} {associatedownersgroup} {associatedvisitorsgroup} Returns the title of the associated member/owners/visitors SharePoint group of a site {sitecollectiontermsetid:[termsetname]} Returns the id of the given termset name located in the sitecollection termgroup
  • 31. OtherTips • Although PnP Provisioning allows us to store default content (e.g. documents, metadata, list items in a template, we decided not to do that). • We are using a Hub site to store standard documents in various libraries. • Use MS Flow to • Copy documents and metadata to each new site • Create Buckets and Tasks in Planner that are defined in lists in the Hub site • This approach allows power users to easily change the default content and Planner items
  • 32. Resources • Provisioing Tokens: • https://github.com/SharePoint/PnP-Sites- Core/blob/master/Core/ProvisioningEngineTokens.md • Overall solution: • https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site- design-pnp-provisioning