I currently use PnP cmdlets to provision a Team Site and want to apply a PnP template that refers to a ContenType usually published by the ContentType Hub. Right now, when I try that, it usually fails because the newly created site was not provided with the ContentTypeHub ContentTypes.
I then started a retry loop to make sure the ContentType is available before applying the template. It becomes available after some time (ranging from 3 minutes to 2 hours)....
Is there a way to force the ContentType to be published on-demand? I already tried clearing the metadata timestamp (Set-PnPPropertyBagValue -key "metadatatimestamp" -value " ") but it did not help.
If not, since my end goal is to provision sites using Azure Function and execution seems limited to 10 minutes, is there a way to be notified when a contenttype is available (ex: webhook) and then trigger an Azure function?
Thanks a lot.