microsoftgraph / microsoftgraph/microsoft-graph-comms-samples

Unable to assign a phone number to a bot

Open
#589 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
253
Forks
275
Avg merge
1d 5h
Merged PRs (30d)
1

Description

I have been trying to assign a number to a bot that I have created so that my bot can answer external calls or forward/transfer accordingly.

I have followed all the instructions from Manage phone numbers for bot.

  1. I have created a bot.

  2. I have created an application instance (resource account), and used the command

    New-CsOnlineApplicationInstance -UserPrincipalName abcaccount@xyz.onmicrosoft.com -ApplicationId XXXX-XXXX-XXXX-XXX-XXX -DisplayName ABCaccount

This step works fine, I can see the resource account in Teams Admin Center. Here the ApplicationId is the App ID of my bot.

  1. I have a free phone number ready to assign.

I am doing this from PowerShell as described in the documentation. But as soon as I try to assign the number I am getting the below error:

Command:

PS C:\WINDOWS\system32> Set-CsPhoneNumberAssignment -Identity abcaccount@xyz.onmicrosoft.com -PhoneNumber +1234567890 -PhoneNumberType CallingPlan

Output:

Microsoft.Teams.ConfigAPI.Cmdlets.internal\Set-CsPhoneNumberAssignment : The user 'XXX-XXX-XXX-XXX-XXX' is not found

At C:\Program Files\WindowsPowerShell\Modules\MicrosoftTeams\4.6.0\custom\Merged_custom_PsExt.ps1:1064 char:9

Microsoft.Teams.ConfigAPI.Cmdlets.internal\Set-CsPhoneNumberA ...

CategoryInfo   : InvalidOperation: ({ Identity = cs...iceEnabled =  }:f__AnonymousType100`5) [Set-CsPhoneNumberAssignment_Set], Exception
FullyQualifiedErrorId : BadRequest,Microsoft.Teams.ConfigAPI.Cmdlets.Generated.Cmdlets.SetCsPhoneNumberAssignment_Set

I cannot figure out why this error is occurring, I can see the resource account in Team Admin Center.
I also tried assigning a number from the team centre page but I got the same error.

Then I created a new resource account but this time I used the default ID of Auto Attendant as mentioned in New-CsOnlineApplicationInstance. And I was able to assign a number successfully.

It seems that passing the bot app ID to New-CsOnlineApplicationInstance for parameter ApplicationId is somehow causing this issue.

If anyone could help me with some pointers that would be great. Am I doing the right thing here? If not, what's the exact way to assign a number to a bot so that the bot can answer external calls?

Thank you for your help.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Manage phone numbers for bot documentation and compare the New-CsOnlineApplicationInstance and Set-CsPhoneNumberAssignment commands, including the ApplicationId value. Reproduce the error with Microsoft Teams PowerShell 4.6.0, then verify the documented bot application identifier can receive the number and answer external calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
api, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.