Hey @William Bao
That's most likely the reason for the error. The code is looking for the request to be either https://pwshfuncapp.azurewebistes.net/api/httptrigger1?name=AzureUser] or for the request body be
{
"name": "AzureUser"
}
Anything outside of that and the PowerShell script can't parse the request which could lead to a 400 error.
EDIT 2024 November 5 Updating my answer to reflect the code sample you shared below. When passing the following request
{
"readings": [
...
]
}
You would use $request.Body.readings
. For PowerShell functions, the body is parsed into a hashtable, so the properties are case-sensitive. You were able to resolve your issue by making passing Reading
as the JSON payload object.