Thank you for reaching out to the Microsoft Q&A platform.
Yes, you are correct that only labs created via the Microsoft Teams app will be visible in Teams. However, I think you can still use PowerShell to assign an Office 365 group to a lab and make the lab accessible via Teams. I haven't tested this scenario though.
To assign an Office 365 group to a lab, you can use the
Set-AzLab cmdlet in PowerShell. Here is an example:
Set-AzLab -ResourceGroupName "MyResourceGroup" -Name "MyLab" -Office365GroupName "MyOffice365Group"
To make the lab accessible via Teams, you can use the
Set-AzLabVNet cmdlet in PowerShell. Here is an example:
Set-AzLabVNet -ResourceGroupName "MyResourceGroup" -LabName "MyLab" -VNetName "MyVNet" -SubnetName "MySubnet" -AllowPublicIP $true -AllowInternetInbound $true -AllowInternetOutbound $true -AllowAzureServicesInbound $true -AllowAzureServicesOutbound $true -AllowTeamsInbound $true
This cmdlet will configure the virtual network for the lab to allow inbound and outbound traffic to and from the internet, Azure services, and Teams.
Note that you will need to have the Azure PowerShell module installed and authenticated to your Azure account to use these cmdlets.
If this does answer your question, please accept it as the answer as a token of appreciation.