Azure APIM - Return response - set-body on error construct a JSON response does not work
Here is my policy statement. I need to construct and return a JSON response upon
@(Convert.ToString(context.Variables["apimErrorContextMessage"]))
application/json
@{
var msg = Convert.ToString(context.Variables["apimErrorContextMessage"])
return $@"{{
""status"": 500,
""message"": ""{msg}"",
""details"": ""{context.LastError?.Message}""
}}";
}