Nov 11 2019
02:58 AM
- last edited on
Apr 01 2022
09:52 AM
by
TechCommunityAP
Nov 11 2019
02:58 AM
- last edited on
Apr 01 2022
09:52 AM
by
TechCommunityAP
Hi All,
We are creating site without Office 365 group using CSOM. But couldnt find the way to associate the hub site to our newly created site.
Any reference / idea will be highly appreciated.
Thanks.
Br,
Prasham
Nov 11 2019 07:24 AM
Nov 11 2019 09:42 PM
@Juan Carlos González Martín Thanks for the reply. Is it possible to share some sample code?
Nov 21 2019 11:05 AM
Hello@Prasham Sabadra !
If I understand you correctly, you have a Hub site in SharePoint Online.
and you want to associate a non-Office365 group connected SharePoint site to that hub?
How did you create that site and what template does it use?
Kind Regards
Oliwer Sjöberg
Dec 08 2019 09:39 PM
I could resolve this issue.
Details:
We are creating Modern Team site without Office 365 group using CSOM. Using Tenant.CreateSite() method as
var tenant = new Tenant(tenantContext);
var spo = tenant.CreateSite(siteCreationProperties);
And then used the Tenant.ConnectSiteToHubSite() method to connect it to Hub site as
//Associating new site to Hub site
tenant.ConnectSiteToHubSite(siteUrl, HubsiteURL);
ccTennant.ExecuteQuery();
It seems to be working fine for me now.
Thanks all for replying and helping :)
Jan 15 2021 01:37 AM
If I am associating a SPO site with hubsite with multigeo scenario means SPO site and hubsite are at different geolocation, then tenantContext will be used of which? site or hubsite?
here in the line
var tenant = new Tenant(tenantContext);
Here , while creating tenantContext, which SiteUrl will be passed? it should be of hubsite or SPO site to be associated.