'Issue assigning phone number to new user MS Teams Powershell : Set-CsPhoneNumberAssignment

I am writing a script to automate the creation of resource accounts in MS Teams using PowerShell and by retrieving infos from Excel file. After creating resource accounts and assigning licenses, i am trying to assign a phone number with the command

Set-CsPhoneNumberAssignment -Identity "upn" -PhoneNumber "+33..." -PhoneNumberType CallingPlan

but I get the same error everytime :

Microsoft.Teams.ConfigAPI.Cmdlets.internal\Set-CsPhoneNumberAssignment : The server responded with a Request Error, Status: NotFound

I seached on google and found that it might be a MS issue, did someone already encounter the same problem?

Thanks !



Solution 1:[1]

You might want to update your MicrosoftTeams module to 4.3.0 (current non-preview) release, restart your PowerShell session and retry. They made some fixes to that cmdlet in that release.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Damien Solodow