I have the following function which adds an item to a queue. Is there anyway of returning other status codes then 500 and 200? I have a case where I check if the caller has access to the endpoint & want to return a 403 if they don't.
[FunctionName("AddToQueue")]
[return: Queue("queue")]
public async Task<PushRequestMessage> AddToQueue(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = "")] HttpRequest req,
ILogger log)
{
if (!_accessRights.HasInternalAccess(req))
{
// return 403
}
return new Message()
{
Title = "Hello"
};
}