Let users connect classic team sites to new Office 365 groups
As a global or SharePoint admin in Office 365, you can allow or prevent site collection administrators from connecting classic team sites to new Office 365 groups. You can also use Microsoft PowerShell or the API to connect sites to new Office 365 groups.
Allow or prevent site collection administrators from connecting classic team sites to new Office 365 groups
Sign in to https://admin.microsoft.com as a global or SharePoint admin to open the Microsoft 365 admin center. (If you see a message that you don't have permission to access the page, you don't have Office 365 administrator permissions in your organization.)
In the left pane of the admin center, under Admin centers, select SharePoint to open the SharePoint admin center. (You might need to select Show more to see the list of admin centers.) If the classic SharePoint admin center appears, select Open it now at the top of the page to open the new SharePoint admin center.
In the left pane, select Settings, and then select classic settings page.
Next to "Allow site owners to create Office 365 groups and attach them to existing sites," select Do not allow site owners to create new Office 365 groups for their existing sites. or Allow site owners to create new Office 365 groups for their existing sites.
When this setting is on, and the site collection administrator for a classic team site (with the template STS#0) is allowed to create groups, they will see the "Connect to a new Office 365 Group" option in settings. For more info, see:
Connect sites to new Office 365 groups using PowerShell: Set-SPOSiteOffice365Group
Connect sites to new Office 365 groups using the CSOM API: CreateGroupForSite method
If your organization has set up OneDrive and SharePoint Multi-Geo, site collection administrators can connect a site to a new Office 365 group only if the site's location matches the user's preferred data location.