Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

TeamsPstnUsage: Usages created with M365DSC don't appear in portal and cannot be deleted even manually

Open ricmestre opened this issue 2 years ago • 0 comments

Description of the issue

After creating 2 PSTN usages (Local and Long Distance) with TeamsPstnUsage for testing so that I could add them to a TeamsVoiceRoutingPolicy and at first glance seem to have worked, nonetheless when trying to delete those usages I've noticed Test-DSCConfiguration reported they were not in desired state. Initially I thought this was some condition that wasn't correct but then I tried to delete them manually with Set-CsOnlinePstnUsage -Usage @{ remove = $Usage } but it always returns Correlation id for this request : new_guid_here and the usages are never removed.

I then checked the Teams admin portal and those usages are not even there on [0] or [1], through those links it's possible to manage the PSTN usages but they are not there and creating a new one won't be listed by running Get-CsOnlinePstnUsage and of course not exported my M365DSC.

This doesn't look like a problem in M365DSC, does Teams module have new cmdlets for retrieving/deleting the usages? Or are they not available?

[0] https://admin.teams.microsoft.com/direct-routing/v2/voice-routes [1] https://admin.teams.microsoft.com/policies/teamsonlinevoicerouting

Microsoft 365 DSC Version

1.23.117.1

Which workloads are affected

Teams

The DSC configuration

TeamsPstnUsage "TeamsPstnUsage-Long Distance"
        {
            Credential           = $Credscredential;
            Ensure               = "Present";
            Usage                = "Long Distance";
        }
        TeamsPstnUsage "TeamsPstnUsage-Local"
        {
            Credential           = $Credscredential;
            Ensure               = "Present";
            Usage                = "Local";
        }

Verbose logs showing the problem

PS C:\> Get-CsOnlinePstnUsage                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     Identity : Global                                                                                                                                                                                                  Usage    : {Long Distance, Local}

PS C:\> Set-CsOnlinePstnUsage -Usage @{ remove = "Local" }                                                                                                                                  Correlation id for this request : cee1c8af-03b4-4ec7-8c52-c94a79ddf506

Environment Information + PowerShell Version

OsName               : Microsoft Windows 11 Enterprise                                                                                                                                                             OsOperatingSystemSKU : EnterpriseEdition                                                                                                                                                                           OsArchitecture       : 64-bit                                                                                                                                                                                      WindowsVersion       : 2009                                                                                                                                                                                        WindowsBuildLabEx    : 22621.1.amd64fre.ni_release.220506-1250                                                                                                                                                     OsLanguage           : en-US                                                                                                                                                                                       OsMuiLanguages       : {en-US, en-GB}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                                                                                                                                     Name                           Value                                                                                                                                                                               ----                           -----                                                                                                                                                                               PSVersion                      5.1.22621.1778                                                                                                                                                                      PSEdition                      Desktop                                                                                                                                                                             PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                             BuildVersion                   10.0.22621.1778                                                                                                                                                                     CLRVersion                     4.0.30319.42000                                                                                                                                                                     WSManStackVersion              3.0                                                                                                                                                                                 PSRemotingProtocolVersion      2.3                                                                                                                                                                                 SerializationVersion           1.1.0.1

ricmestre avatar Jan 23 '24 16:01 ricmestre