Content Type synchronization and site script issue while adding content type to list

Harikrishnan P 1 Reputation point


In our current setup site provisioning is done using flow, site design, and azure runbooks. Since our site uses different custom content types we have added 1-hour delay in the flow to sync the content types to the newly created site. After that using site design, different lists will be created and respective content types will be added to the list.

Due to the changes happening in content type synchronization logic we are redesigning the current system. So just after creating the site, I used the command Add-PnPContentTypesFromContentTypeHub to sync the content types to the new site. Even though it's throwing an error the content types are getting synced. however, the issue is the site design scripts are not able to add the content types to the list, it's just creating the list. Since the site design option is replaced by site template , I'm not able to see the log of applying site design.

Does anybody face this issue?

I also read that,

A new verb is also being developed (addContentTypesFromHub) for use within SharePoint site script actions. This is expected to be available by the end of 2021.

Do I need to wait to get addContentTypesFromHub action to successfully implement the system I described in this post?

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,042 questions
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Allen Xu_MSFT 13,511 Reputation points

    Hi @Harikrishnan P ,

    Yes due to the changes in content type publishing, I think in your case the only way is to wait for the new verb that is being developed for use to update the site design scripts so that you can implement the sysytem then.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

  2. Harikrishnan P 1 Reputation point

    @Allen Xu_MSFT Sorry for the late response. So if I want to add the content type using site design I need to use the new verb 'Add-PnPContentTypesFromContentTypeHub' right?

    In the latest update from Microsoft (MC295852), I read that automatic content type synchronization will be stopped by end of January.

    Blockquote any scripts that add a published content type in a site for the first time need to use one of these methods. Any solutions that depend on waiting for a published content type to get copied to all sites won’t work going forward.

    So this verb 'Add-PnPContentTypesFromContentTypeHub' is the only way to add content type in the site and this verb is not released yet, so if the auto-syncing is stopped it will break my site provisioning.