SOLVED

PnP: Provisioning a site and trigger a Flow or Function

%3CLINGO-SUB%20id%3D%22lingo-sub-774692%22%20slang%3D%22en-US%22%3EPnP%3A%20Provisioning%20a%20site%20and%20trigger%20a%20Flow%20or%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774692%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI'm%20using%20PnP%20Provisioning%20engine%20to%20create%20new%20sites%2Fgroups.%20I%20want%20to%20start%20a%20flow%20or%20function%20after%20or%20during%20the%20provisioning.%20I've%20tried%20using%20the%20SiteWebHooks%3A%3C%2FP%3E%3CPRE%3E%3CSITEWEBHOOKS%3E%3CBR%20%2F%3E%20%20%3CWEBHOOK%20servernotificationurl%3D%22%26lt%3BA%20href%3D%22%3Ehttps%3A%2F%2Fmytrigger.azurewebsites.net%2Fapi%2FHttpTrigger1%3Fcode%3Dthecode%22%20ExpiresInDays%3D%2231%22%20SiteWebhookType%3D%22WebCreated%22%20%2F%26gt%3B%3CBR%20%2F%3E%26lt%3B%2Fpnp%3ASiteWebhooks%26gt%3B%3C%2FWEBHOOK%3E%3C%2FSITEWEBHOOKS%3E%3C%2FPRE%3E%3CP%3EIt%20seems%20that%20this%20webhook%20was%20created%20to%20so%20some%20tasks%20for%20the%20pnp%20schema%3A%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2Fvrdmn%2Fstatus%2F889862682341511168%3Fs%3D20%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftwitter.com%2Fvrdmn%2Fstatus%2F889862682341511168%3Fs%3D20%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20see%20some%20other%20workarounds%3A%3C%2FP%3E%3CP%3E1.%20Create%20a%20custom%20SPFx%20app%20to%20start%20a%20flow%20or%20function%3C%2FP%3E%3CP%3E2.%20Create%20a%20site%20from%20a%20site%20design%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20have%20an%20idea%20to%20start%20flow%20from%20PnP%20Provisioning%20Engine%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3EBernd%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-774692%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-775458%22%20slang%3D%22en-US%22%3ERe%3A%20PnP%3A%20Provisioning%20a%20site%20and%20trigger%20a%20Flow%20or%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-775458%22%20slang%3D%22en-US%22%3E%3CP%3EHey%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F8293%22%20target%3D%22_blank%22%3E%40Bernd%20Verhofstadt%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20ran%20into%20a%20similar%20problem%20recently.%20Basically%2C%20we%20have%20a%20governance%20system%20to%20record%20any%20team%20created.%20And%20I%20needed%20to%20know%20whether%20the%20provision%20was%20ready%20or%20not.%20My%20solution%20was%20to%20have%20a%20%22Governance%22%20List%2C%20where%20each%20item%20is%20a%20site%20created.%20the%20list%20also%20has%20a%20column%20%22isReady%22%20that%20I%20update%20to%20%22yes%22%20when%20my%20powershell%20script%20is%20done%20provisioning.%20So%20that's%20an%20option%20for%20you.%20Basically%2C%20you%20have%20a%20list%20to%20keep%20tracking%20of%20provisioning%2C%20have%20your%20script%20set(or%20create)%20an%20item%20in%20this%20list%2C%20and%20create%20a%20Flow%20to%20check%2C%20when%20an%20item%20is%20updated(or%20created)%20if%20it%20is%20ready%2C%20aka%20finished%20provisioning.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%20me%20know%20if%20you%20need%20any%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

Hi,

I'm using PnP Provisioning engine to create new sites/groups. I want to start a flow or function after or during the provisioning. I've tried using the SiteWebHooks:

<pnp:SiteWebhooks>
<pnp:Webhook ServerNotificationUrl="https://mytrigger.azurewebsites.net/api/HttpTrigger1?code=thecode" ExpiresInDays="31" SiteWebhookType="WebCreated" />
</pnp:SiteWebhooks>

It seems that this webhook was created to so some tasks for the pnp schema:

https://twitter.com/vrdmn/status/889862682341511168?s=20

 

I see some other workarounds:

1. Create a custom SPFx app to start a flow or function

2. Create a site from a site design

 

Does anyone have an idea to start flow from PnP Provisioning Engine?

 

Best regards,

Bernd

1 Reply
Highlighted
Solution

Hey @Bernd Verhofstadt ,

 

I ran into a similar problem recently. Basically, we have a governance system to record any team created. And I needed to know whether the provision was ready or not. My solution was to have a "Governance" List, where each item is a site created. the list also has a column "isReady" that I update to "yes" when my powershell script is done provisioning. So that's an option for you. Basically, you have a list to keep tracking of provisioning, have your script set(or create) an item in this list, and create a Flow to check, when an item is updated(or created) if it is ready, aka finished provisioning.

 

Let me know if you need any help.