How should one parse the chat text received as JSON payload in the request body when using an outgoing webhook as an application in a Teams group to fetch the output of a PowerShell Azure function?
using namespace System.Net
param($Request, $TriggerMetadata)
$text =($Request.Body|ConvertFrom-Json).text #Parse request body to extract message text
$Response = @{ #This simply echoes the received text
type = 'message'
text = "You said: $text"} | ConvertTo-Json
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode= [HttpStatusCode]::OK
Body = $Response})
The code is working partially so that I can get the text output of the function ['You said'] as a response in Teams. However, it cannot parse the text passed while calling the function in Teams and echo it in the response.

$Request.Body? What message do you receive if you dotext = "You said: '$($Request.Body)'"?You said: 'System.Management.Automation.OrderedHashtable'$Request.Body(maybe) already contains the parsed json in a hashtable and$text = $Request.Body | ComvertFrom-Jsonis silently failing, leaving$textequal to$nulland results in the output stringYou said:. Try$text = $Request.Body.textinstead and see if that shows the text in the output message…$text = $Request.Body.textresults in a null output afterYou said:too.