Automation - Create Labs via MS Teams

DOAN LE 1 Reputation point

hi MS support,

I need to setup automated processes to perform below:

  1. create new Lab
  2. assign O365 group to the new Lab for user sync
  3. make the lab accessible via MS Teams

However, it seems only Labs created via MS Teams App will be visible in Teams based on the doco link:

I can use Powershell to perform #1 but can't find any doco to perform the #2 and #3.

Can you kindly assist ?


Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,399 questions
Azure Lab Services
Azure Lab Services
An Azure service that is used to set up labs for classrooms, trials, development and testing, and other scenarios.
285 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Prrudram-MSFT 22,926 Reputation points

    @DOAN LE

    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.