Share via

Function App with Powershell MicrosoftTeams: System.Collections.ListDictionaryInternal

Demesne 1 Reputation point
2021-05-19T16:19:34.337+00:00

The powershell Function app is failing when any of the migrated Skype cmdlets are used (Ordinary MicrosoftTeams cmdLet like 'Get-Teams' are working correctly. The latest Module MicrosoftTeams 2.3.1 is used in this instance.

Is there any recommends/suggestions to work around the issue when receiving the type 'System.Collections.ListDictionaryInternal' is not supported for serialization or deserialization of a dictionary. Keys must be strings?

using namespace System.Net

Input bindings are passed in via param block.

param($Request, $TriggerMetadata)
try {

Write to the Azure Functions log stream.

Write-Host "PowerShell HTTP trigger function processed a request."
$UserPrincipalName = "******@test.onmicrosoft.com"

WORKS OK.

$myTeams = Get-Team -User $UserPrincipalName
Write-Output $myTeams

 #  FAILED HERE.
$csUser = Get-CsOnlineUser -Identity $UserPrincipalName

2021-05-19T15:57:43.947 [Error] Executed 'Functions.HttpTrigger1' (Failed, Id=bfc1bca4-98ca-4f31-84df-aba514dc7f9a, Duration=35506ms)Result: FailureException: The type 'System.Collections.ListDictionaryInternal' is not supported for serialization or deserialization of a dictionary. Keys must be strings.Stack: at Microsoft.PowerShell.Commands.JsonObject.ProcessDictionary(IDictionary dict, Int32 depth, ConvertToJsonContext& context)at Microsoft.PowerShell.Commands.JsonObject.ProcessValue(Object obj, Int32 currentDepth, ConvertToJsonContext& context)at Microsoft.PowerShell.Commands.JsonObject.ProcessCustomObject[T](Object o, Int32 depth, ConvertToJsonContext& context)at Microsoft.PowerShell.Commands.JsonObject.ProcessValue(Object obj, Int32 currentDepth, ConvertToJsonContext& context)at Microsoft.PowerShell.Commands.JsonObject.ProcessCustomObject[T](Object o, Int32 depth, ConvertToJsonContext& context)at Microsoft.PowerShell.Commands.JsonObject.ProcessValue(Object obj, Int32 currentDepth, ConvertToJsonContext& context)at Microsoft.PowerShell.Commands.JsonObject.ConvertToJson(Object objectToProcess, ConvertToJsonContext& context)at Microsoft.Azure.Functions.PowerShellWorker.Utility.TypeExtensions.ConvertToJson(Object fromObj) in /home/vsts/work/1/s/src/Utility/TypeExtensions.cs:line 149at Microsoft.Azure.Functions.PowerShellWorker.Utility.TypeExtensions.ToTypedData(Object value) in /home/vsts/work/1/s/src/Utility/TypeExtensions.cs:line 247at Microsoft.Azure.Functions.PowerShellWorker.Utility.TypeExtensions.ToRpcHttp(HttpResponseContext httpResponseContext) in /home/vsts/work/1/s/src/Utility/TypeExtensions.cs:line 164at Microsoft.Azure.Functions.PowerShellWorker.Utility.TypeExtensions.ToTypedData(Object value) in /home/vsts/work/1/s/src/Utility/TypeExtensions.cs:line 241at Microsoft.Azure.Functions.PowerShellWorker.RequestProcessor.BindOutputFromResult(InvocationResponse response, AzFunctionInfo functionInfo, IDictionary results) in /home/vsts/work/1/s/src/RequestProcessor.cs:line 465at Microsoft.Azure.Functions.PowerShellWorker.RequestProcessor.ProcessInvocationRequestImpl(StreamingMessage request, AzFunctionInfo functionInfo, PowerShellManager psManager, FunctionInvocationPerformanceStopwatch stopwatch) in /home/vsts/work/1/s/src/RequestProcessor.cs:line 308

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.

Windows for business | Windows Server | User experience | PowerShell

1 answer

Sort by: Most helpful
  1. JayaC-MSFT 5,606 Reputation points
    2021-05-23T16:15:11.773+00:00

    This issue has been resolved after a while.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.