Teams Calling Bot Installation
Connect your Microsoft 365 tenant to the VoIP Toolbox Teams calling bot by granting consent, creating a Teams application instance (resource account) linked to our bot, and licensing it for voice.
Who does this? A Global Administrator in the customer Microsoft 365 tenant. You need the tenant's Azure AD tenant ID (GUID) from Microsoft Entra ID → Overview.
Grant admin consent in your tenant
Allow the VoIP Toolbox calling application to use Microsoft Graph call permissions in your tenant. Complete this once per customer tenant.
Log in to generate a tenant-specific admin consent URL.
Log InMicrosoft reference: Admin consent on the Microsoft identity platform.
Create a Teams application instance
Register a resource account in your tenant that is bound to the VoIP Toolbox bot application ID. The UPN must use a verified Microsoft 365 / Teams domain (for example voiptoolbox-bot@contoso.onmicrosoft.com).
- Install the Microsoft Teams PowerShell module if needed.
- Connect as a Teams administrator:
Connect-MicrosoftTeams -
Run
New-CsOnlineApplicationInstancewith your bot's application ID (29c7300e-925f-4ba0-87ae-f0f4c7a13f70).
New-CsOnlineApplicationInstance -UserPrincipalName voiptoolbox-calling-bot@yourtenant.onmicrosoft.com -ApplicationId 29c7300e-925f-4ba0-87ae-f0f4c7a13f70 -DisplayName "VoIP Toolbox Teams Calling Bot"
After creating the instance, look up its Object ID (required for outbound PSTN calls via Graph):
Get-CsOnlineApplicationInstance -Identity voiptoolbox-calling-bot@yourtenant.onmicrosoft.com | Select-Object ObjectId, ApplicationId, PhoneNumber, UserPrincipalName
Microsoft reference: New-CsOnlineApplicationInstance, Phone numbers for bots (Graph).
License the resource account
Assign a Teams Phone Resource Account (virtual user) license to the application instance in the Microsoft 365 admin center.
- Open the Microsoft 365 admin center.
- Go to Billing → Licenses, or Users → Active users and find the application instance
- Assign Microsoft Teams Phone Resource Account (and a Calling Plan license if you will assign a service phone number in the next step).
Optional: phone number and voice in Teams Admin Center
To receive PSTN calls on the bot, assign a service phone number to the resource account and ensure voice is enabled. Skip this step if you only need Teams-to-Teams tests without a number.
- Open the Teams admin center.
- Go to Voice → Phone numbers and acquire or assign a number to the resource account (Calling Plan, Direct Routing, or Operator Connect).
- Under Voice → Resource accounts, confirm the account is voice-enabled and shows the assigned number.
- Place a test call to that number and confirm VoIP Toolbox handles the call as expected.
Enable outbound calls via Direct Routing
To let the bot place outbound PSTN calls through VoIP Toolbox Direct Routing, create a PSTN usage for your voice route domain, assign a voice routing policy to the bot, and optionally assign a test phone number.
Prerequisite: Complete
Teams Direct Routing Setup
first, through step 4 (domain verified and your derived trunk
example-123.probeXX.voiptoolbox.net
added to a voice route). Also complete steps A–C above for this bot.
- Connect as a Teams administrator:
Connect-MicrosoftTeams - Add a PSTN usage named after your Direct Routing domain. This links your voice route to the bot's outbound policy:
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="example-123.probeXX.voiptoolbox.net"}
-
Edit the voice route from Direct Routing setup step 4 and add PSTN usage
example-123.probeXX.voiptoolbox.net. In the Teams Admin Center, open Voice → Direct Routing → Voice routes, select your route, and add the PSTN usage under PSTN usage records. - Create a voice routing policy that includes the same PSTN usage:
New-CsOnlineVoiceRoutingPolicy "VoIP Toolbox Bot Outbound" -OnlinePstnUsages "example-123.probeXX.voiptoolbox.net"
- Grant the voice routing policy to your bot application instance (use the UPN you saved in step B):
Grant-CsOnlineVoiceRoutingPolicy -Identity voiptoolbox-calling-bot@yourtenant.onmicrosoft.com -PolicyName "VoIP Toolbox Bot Outbound"
-
Recommended: assign a Direct Routing phone number to the bot for outbound caller ID. With Direct Routing you can use any number for this type of testing, for example
+11000010000:
Set-CsPhoneNumberAssignment -Identity voiptoolbox-calling-bot@yourtenant.onmicrosoft.com -PhoneNumber +11000010000 -PhoneNumberType DirectRouting
Microsoft reference: Configure call routing for Direct Routing, Set-CsPhoneNumberAssignment.