Manage Microsoft Teams Direct Routing customers and numbers with Azure Communications Gateway

Providing Microsoft Teams Direct Routing service with Azure Communications Gateway requires configuration on Azure Communications Gateway and in customer tenants. This article provides guidance on how to set up Direct Routing for a customer, including:

  • Setting up a new customer.
  • Managing numbers for a customer, including optionally configuring a custom header.

Tip

You typically need to ask your customers to change their tenants configuration, because your organization won't have permission.

For more information about how Azure Communications Gateway and Microsoft Teams use tenant configuration to route calls, see Support for multiple customers with the Microsoft Teams multitenant model.

Prerequisites

Connect Azure Communications Gateway to Microsoft Teams Direct Routing.

During this procedure, you provision Azure Communications Gateway with the details of the enterprise customer tenant and numbers for the enterprise.

  • To use Azure Communications Gateway's Number Management Portal (preview) for provisioning (recommended), you must have Reader access to the Azure Communications Gateway resource and ProvisioningAPI.ReadUser and ProvisioningAPI.WriteUser roles for the AzureCommunicationsGateway enterprise application.
  • To use Azure Communications Gateway's Provisioning API (preview), you must be able to make requests using a client integrated with the API. You must also have access to the API Reference.

The enterprise must be able to allocate at least two user or resource accounts licensed for Microsoft Teams, because they need to use these accounts to activate domain names. For more information on suitable licenses, see the Microsoft Teams documentation.

Set up Direct Routing for a customer

When you set up Direct Routing for a customer, you need to configure Azure Communications Gateway with an account for the customer, and ask the customer to configure their tenant to connect to Azure Communications Gateway.

This procedure provides detailed guidance equivalent to the following steps in the Microsoft Teams documentation for configuring an SBC for multiple tenants.

  1. Registering a subdomain name in the customer tenant.
  2. Configuring derived trunks in the customer tenant (including failover).

Choose a DNS subdomain label to use to identify the customer

Azure Communications Gateway has per-region domain names for connecting to Microsoft Teams Direct Routing. You need to choose subdomains of these domain names for your customer. Microsoft Phone System and Azure Communications Gateway use these subdomains to match calls to tenants.

  1. Work out the per-region domain names for connecting to Microsoft Teams Direct Routing. These domain names use the form 1r<region-number>.<base-domain-name>. The base domain name is the Domain on your Azure Communications Gateway resource in the Azure portal.
  2. Choose a suitable customer-specific DNS label to form the subdomains.
    • The label must be up to nine characters in length and can only contain letters, numbers, underscores, and dashes.
    • You must not use wildcard subdomains or subdomains with multiple labels.
    • For example, you could allocate the label contoso.

    Important

    The full customer subdomains (including the per-region domain names) must be a maximum of 48 characters. Microsoft Entra ID does not support domain names of more than 48 characters. For example, the customer subdomain contoso1.1r1.a1b2c3d4e5f6g7h8.commsgw.azure.com is 48 characters.

  3. Use this label to create a customer subdomain of each per-region domain name for your Azure Communications Gateway.
  4. Make a note of the label you choose and the corresponding customer subdomains.

For example:

  • Your base domain name might be <deployment-id>.commsgw.azure.com, where <deployment-id> is autogenerated and unique to the deployment.
  • Your per-region domain names are therefore:
    • 1r1.<deployment-id>.commsgw.azure.com
    • 1r2.<deployment-id>.commsgw.azure.com
  • If you allocate the label contoso, this label combined with the per-region domain names creates the following customer subdomains for your customer:
    • contoso.1r1.<deployment-id>.commsgw.azure.com
    • contoso.1r2.<deployment-id>.commsgw.azure.com

Important

The per-region domain names for connecting to Microsoft Teams Direct Routing are different to the per-region domain names for connecting to your network.

Tip

Lab deployments have one per-region domain name. A customer for a lab deployment therefore also only has one customer subdomain.

Ask the customer to register the subdomains in their tenant and get DNS TXT values

The customer tenant must be configured with the customer subdomains that you allocated in Choose a DNS subdomain label to use to identify the customer. Microsoft 365 then requires you (as the carrier) to create DNS records that use a verification code from the enterprise.

Provide your customer with the customer subdomains and ask them to carry out the following steps.

  1. Sign into the Microsoft 365 admin center as a Global Administrator.
  2. Using Add a subdomain to the customer tenant and verify it:
    1. Register the first customer subdomain (for example contoso.1r1.<deployment-id>.commsgw.azure.com).
    2. Start the verification process using TXT records.
    3. Note the TXT value that Microsoft 365 provides.
  3. Repeat the previous step for the second customer subdomain.

Important

Your customer must not complete the verification process yet. You must carry out Configure the customer on Azure Communications Gateway and generate DNS records first.

Configure the customer on Azure Communications Gateway and generate DNS records

Azure Communications Gateway includes a DNS server that you must use to generate the DNS records required to verify the customer subdomains. Provision the details of the customer tenant and the DNS TXT values on Azure Communications Gateway.

  1. From the overview page for your Communications Gateway resource, find the Number Management section in the sidebar.
  2. Select Accounts.
  3. Select Create account.
  4. Enter an Account name and select the Enable Teams Direct Routing checkbox.
  5. Set Teams tenant ID to the ID of the customer tenant.
  6. Optionally, select Enable call screening. This screening ensures that customers can only place Direct Routing calls from numbers that you assign to them.
  7. Set Subdomain to the label for the subdomain that you chose in Choose a DNS subdomain label to use to identify the customer (for example, contoso).
  8. Set the Subdomain token region fields to the TXT values that the customer provided when they registered the subdomains.
  9. Select Create.
  10. Confirm that the DNS records have been generated.
    1. On the Accounts pane, select the account name in the list.
    2. Confirm that Subdomain Provisioned State is Provisioned.

Ask the customer to finish verifying the domains in the customer tenant

After you use Azure Communications Gateway to generate the DNS records for the customer subdomains, ask your customer to verify the subdomains in their Microsoft 365 admin center.

The customer must:

  1. Sign into the Microsoft 365 admin center for the customer tenant as a Global Administrator.
  2. Select Settings > Domains.
  3. Finish verifying the customer subdomains by following Add a subdomain to the customer tenant and verify it.

Ask the customer to activate the domains in the customer tenant

To activate the customer subdomains in Microsoft 365, set up at least one user or resource account licensed for Microsoft Teams for each domain name. For information on the licenses you can use and instructions, see Activate the subdomain name.

Important

Ensure the accounts use the customer subdomains (for example, contoso.1r1.<deployment-id>.commsgw.azure.com), instead of any existing domain names in the tenant.

Ask the customer to configure call routing that uses Azure Communications Gateway

Ask the customer to configure a call routing policy (also called a voice routing policy) with a voice route that routes calls to Azure Communications Gateway.

The customer must:

Important

You must use PowerShell to set the PSTN gateways for the voice route, because the Microsoft Teams Admin Center doesn't support adding derived trunks. You can use the Microsoft Teams Admin Center for all other voice route configuration.

To set the PSTN gateways for a voice route, use the following PowerShell command.

Set-CsOnlineVoiceRoute -id "<voice-route-id>" -OnlinePstnGatewayList <customer-subdomain-1>, <customer-subdomain-2>

Manage numbers for a customer

When you allocate numbers to a customer, you need to provision those numbers on Azure Communications gateway, and ask the customer to configure their tenant with those numbers.

Configure the numbers on Azure Communications Gateway

When you set up Direct Routing for the customer, you configured Azure Communications Gateway with an account for the customer. You must configure the numbers that you allocate to the customer under this account.

  1. From the overview page for your Communications Gateway resource, find the Number Management section in the sidebar. Select Accounts.
  2. Select the checkbox next to the enterprise's Account name and select View numbers.
  3. Select Create numbers.
  4. Select Enable Teams Direct Routing.
  5. Optionally, enter a value for Custom SIP header.
  6. Add the numbers in Telephone Numbers.
  7. Select Create.

To change or remove existing numbers:

  1. From the overview page for your Communications Gateway resource, find the Number Management section in the sidebar. Select Accounts.
  2. Select the checkbox next to the customer's Account name and select View numbers.
  3. Select the checkbox next to the number you want to change or remove and select Manage number or Delete numbers.

Ask the customer to configure users in their tenant

Your customer can now set up users for Microsoft Teams Direct Routing. To add new numbers, they must:

  1. Enable users for Microsoft Teams Direct Routing, by following Enable users for Direct Routing.
  2. Configure these users with the voice route for Azure Communications Gateway that they configured earlier. For instructions, see the steps for assigning voice routing policies in Configure call routing for Direct Routing.

Next step