How to create new team and Link existing SharePoint Site programmatically instead of new site.

Occasional Contributor



I am working on an automation where I need to create a team dynamically and need to link it with an existing SharePoint site which is a subsite in the site collection. is there any way, I can link existing SharePoint site with a team in the MS Teams?


If above is not possible, then alternatively, is there any way, I can link "files" tab to an existing SharePoint Library programmatically?





6 Replies
It does not help. I need to connect "Files" of MS Team, to a SharePoint Document Library.
Perhaps you should update the topic and not asking how to "Create new team using existing SharePoint Site".
I updated the topic.

ping @ganeshsanap Do you understand the request here?

@Rajesh Lohar You cannot add a Microsoft Team to a subsite, Teams can only be added to Sites (Site collections) which are connected to Microsoft 365 Groups.


Check below links to "Teamify" existing subsites:

  1. “Teamify” existing subsites with the help of ShareGate Desktop 
  2. Can i link a sub-site insdie a classic team site to a MS Teams 

Also, check this article about how to use existing SharePoint library as files tab in Microsoft Teams (not sure if it is still supported): Microsoft Teams: Use an Existing SharePoint Library 


However, you can always add any SharePoint library/page as a Tab in any Team/Channel. Integrate existing SharePoint 365 website into Microsoft Teams 

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.