How to create Visio Process Repo Site collection programmatically using CSOM?

Yuvraj Patil 361 Reputation points
2023-05-24T12:49:24.35+00:00

Hi,

I would like to create a Visio Process Repository site collection using CSOM, could you please tell me the Template to be used to create this site collection and sample code as well.

Visio Process Repo

Thanks,
Yuvraj.

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,236 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,737 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,686 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,576 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 31,681 Reputation points Microsoft Vendor
    2023-05-25T05:30:39.66+00:00

    Hi @Yuvraj Patil,

    The Visio Process Repository site template id is visprus#0. Per my test, I can create a site by following code

                    var tenant = new Tenant(tenantContext);
    
                    //Properties of the New SiteCollection
                    var siteCreationProperties = new SiteCreationProperties();
                    //New SiteCollection Url
                    siteCreationProperties.Url = "https://xxx.sharepoint.com/sites/codesite02";
                    //Title of the Root Site
                    siteCreationProperties.Title = "Site Created from Code02";
                    //Email of Owner
                    siteCreationProperties.Owner = "xxx";
                    //Template of the Root Site. Using Team Site for now.
                    siteCreationProperties.Template = "visprus#0";
                    //Storage Limit in MB
                    siteCreationProperties.StorageMaximumLevel = 100;
                    //UserCode Resource Points Allowed
                    siteCreationProperties.UserCodeMaximumLevel = 50;
    
                    //Create the SiteCollection
                    SpoOperation spo = tenant.CreateSite(siteCreationProperties);
    
                    tenantContext.Load(tenant);
                    tenantContext.Load(spo, i => i.IsComplete);
                    tenantContext.ExecuteQuery();
    
                    //Check if provisioning of the SiteCollection is complete.
                    while (!spo.IsComplete)
                    {
                        //Wait for 30 seconds and then try again
                        System.Threading.Thread.Sleep(30000);
                        spo.RefreshLoad();
                        tenantContext.ExecuteQuery();
                    }
    
                    Console.WriteLine("SiteCollection Created.");
    
    
    
    

    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.