Using a custom VNET with the Teams Connector

If you need more control over the Teams Connector VNET, you can deploy and use your own customized VNET instead of the VNET that is created by a default Teams Connector installation.

However, your VNET must still meet the requirements of the Teams Connector environment, and thus you must use a script provided by Pexip to deploy your custom VNET.

Creating the custom VNET

You must use the create_vnet_deployment.ps1 script from the Teams Connector ZIP file to deploy your customized VNET.

This script ensures that the VNET meets all the required criteria and prerequisites for use with the Teams Connector.

These are the parameters of the create_vnet_deployment.ps1 script:

Parameter Mandatory Description
ResourceGroupName Yes

The name of the resource group to use.

Example: "pexip-TeamsConn-eu-static-RG"

VnetName No The name of the VNET. If omitted the name is generated in the format "pexip-tc-{uid}-VNET".
VnetAddressPrefixes No

An array of virtual network address prefixes.

Default: @("")

VmssSubnetAddressPrefix No

Specifies the subnet for the VMSS.

Default: "".

FuncSubnetAddressPrefix No

Specifies the subnet for Azure functions.

Default: "".

Tags No

Optional tags (name-value pairs) to apply to Azure resources and resource groups ($tags in the variable script).

Example: @{"ResourceOwner"="user@domain"; "CostCenter"="Video Services";}

Note that:

  • The VNET must be in the same subscription as your Teams Connector.
  • We recommend that you assign the $resourceGroupName variable in the following example script to use the static resource group for the VNET (i.e. $PxTeamsConnStaticResourceGroupName in the variables initialization script). It will be created if it does not already exist.
  • You should run your variables initialization script to set the $PxAzureLocation and $PxSubscriptionId variables.
  • You should create the VNET in advance of deploying the Teams Connector.
  • The NSG attached to the VNET is not customizable and is created during the deployment of the Teams Connector.

Using your own preferred subnet ranges, you could run the create_vnet_deployment.ps1 script as:

Copy to clipboard
# Name of the resource group to use. We recommend using the static resource group i.e. $PxTeamsConnStaticResourceGroupName
# in the variable script. For example "pexip-TeamsConn-eu-static-RG"
# The resource group is created if it does not already exist
$resourceGroupName = ""

# Azure Region (must be a supported region) in lowercase: uses $PxAzureLocation in the variable script

# Optional tags (name-value pairs) to apply to Azure resources and resource groups ($tags in the variable script)
# For example $tags= @{"ResourceOwner"="user@domain"; "CostCenter"="Video Services";}
$tags = @{}


Set-AzContext -SubscriptionId $PxSubscriptionId

$exists = Get-AzResourceGroup -Name $resourceGroupName -Location $PxAzureLocation -ErrorAction SilentlyContinue
if (!$exists) {
  New-AzResourceGroup -Name $resourceGroupName -Location $PxAzureLocation -Tag $tags
} else {
  Write-Host "The resource group $($exists.ResourceGroupName) already exists."

# Make sure to call this script from the expanded TeamsConnector ZIP folder
# You can assign a custom VNET name by providing a -VnetName parameter, otherwise "pexip-tc-{uid}-VNET" is used

./create_vnet_deployment.ps1 -ResourceGroupName $resourceGroupName -VnetAddressPrefixes @("") -VmssSubnetAddressPrefix ""  -FuncSubnetAddressPrefix "" -Tags $tags

# Example of script output:
# Deploying VNET
# Deployed VNET: "pexip-tc-{uid}-VNET"
# Deployed VNET resource ID: {VNET resource ID}

Blue-green deployments

If you are also following (or planning to follow) a blue-green deployment strategy, you should set up a second VNET in the other static resource group.

Use the name of the other e.g. "green" static resource group for the $resourceGroupName variable.

Using the custom VNET

When you deploy the Teams Connector you reference the VNET by setting $PxExistingVNETResourceId in the variables script to the VNET’s resource ID:

  • Use the output of the create_vnet_deployment.ps1 script — line "Deployed VNET resource ID: {VNET resource ID}".
  • The resource ID can also be retrieved from Azure Portal > VNET resource > JSON view > Resource ID.

The resource ID is then passed as the -ExistingVNETResourceId parameter in the create_vmss_deployment.ps1 script. The Teams Connector VMs being deployed are then attached to this custom VNET instead of the default VNET.

Note that if the custom VNET is deployed into the static resource group, the deployment script will use this custom VNET automatically (without the need to specify the -ExistingVNETResourceId parameter).