Hi anonymous user
Welcome to Microsoft Q&A! Thanks for posting the question.
If you check your first screenshot you have written some piece of code that is not saved and when you try to run that the last saved code (default code when you create any trigger) was executed. That is the reason you will see in the output the message as "Hello, Azure. This HTTP triggered function executed successfully." The default code is as below:
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
# Write to the Azure Functions log stream.
Write-Host "PowerShell HTTP trigger function processed a request."
# Interact with query parameters or the body of the request.
$name = $Request.Query.Name
if (-not $name) {
$name = $Request.Body.Name
}
$body = "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
if ($name) {
$body = "Hello, $name. This HTTP triggered function executed successfully."
}
# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [HttpStatusCode]::OK
Body = $body
})
The error is the expected in your error screenshot as you have removed the param($Request, $TriggerMetadata) to get the metadata and the function couldn't execute and throws 500 error. You can review Azure function HTTP trigger to learn more about configuration and working.