Rediger

Provision classic team sites in a Multi-Geo environment

The SharePoint Add-in portions of this article are legacy guidance. The retirement below doesn't retire the other APIs or platforms discussed here.

Important

SharePoint Add-ins reached end of life in SharePoint Online on April 2, 2026. Both SharePoint-hosted and provider-hosted Add-ins are retired and no longer work in SharePoint Online, including government clouds. Add-in development, deployment, and usage guidance is retained for historical reference and for applicable SharePoint Server scenarios, not for new SharePoint Online solutions.

SharePoint Server Add-ins deployed through an on-premises app catalog are not retired by this change. Acquiring SharePoint Add-ins from the public marketplace ended on April 2, 2026 for SharePoint Server.

This retirement does not retire SharePoint REST APIs, CSOM, JSOM, or SharePoint Framework (SPFx). For SharePoint Online, use SPFx for user interface extensions and Microsoft Entra ID for authentication to external applications. See the retirement announcement and Add-in migration guidance.

SharePoint sites can be spread across the default and satellite geo locations of a Multi-Geo tenant. When your custom development (script, app, console application, node.js app, and so on) needs to provision sites, it's important to be aware of the geo locations in your Multi-Geo tenant.

When provisioning classic team site collections (for example, STS#0-based site collections), you need to use the CSOM CreateSite method call as explained and shown in following articles and samples:

The CreateSite method call needs to be executed on an instantiated Tenant object, and a tenant object requires you to specify an SPO Admin center URL to be created.

To create a classic team site:

  1. Determine the geo location that needs to host the site collection (for example, the European satellite).

  2. Use the guidance explained in the article Discover a Multi-Geo tenant configuration to find the tenant admin site and SharePoint root URLs for the geo location.

  3. Create a Tenant object by using the discovered admin site URL.

  4. Use the CreateSite method call to create the site collection.

The following sample shows how to provision a site collection in the European geo location.

// Use the Multi-Geo discovery guidance to discover the tenant admin and root site URLs for this geo location.
string tenantAdminSiteForMyGeoLocation = "https://contoso-europe-admin.sharepoint.com";
string targetUrl = "https://contoso-europe.sharepoint.com/sites/demosite";
string owner = "UserA@contoso.onmicrosoft.com";

using (var ctx = new ClientRuntimeContext(tenantAdminSiteForMyGeoLocation))
{
    ctx.Credentials = adminCredentials;
    
    var tenant = new Tenant(ctx);
    
    //Create new site.
    var newsite = new SiteCreationProperties()
    {
        Url = targetUrl,
        Owner = owner,
        Template = "STS#0",
        Title = title,
        StorageMaximumLevel = 1000,
        StorageWarningLevel = 500,
        TimeZoneId = 7,
    };
    
    var spoOperation = tenant.CreateSite(newsite);
    
    ctx.Load(spoOperation);
    ctx.ExecuteQuery();
    
    while (!spoOperation.IsComplete)
    {
        Thread.Sleep(2000);
        ctx.Load(spoOperation);
        ctx.ExecuteQuery();
        Console.WriteLine("Site creation status: " + (spoOperation.IsComplete ? "waiting" : "complete"));
    }
}

Note

To learn more about the needed permissions and how to configure your applications, see Set up a Multi-Geo sample application.

See also