, , . (, , ..) / .
, :
public static class SomeEventProcessor
{
[FunctionName("SomeEventProcessor")]
public static async Task<HttpResponseMessage> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post")]HttpRequestMessage req,
TraceWriter log,
[Queue("myQueueName", Connection = "myconnection")] IAsyncCollector<EventInfo> outputQueue)
{
log.Info("C# HTTP trigger function processed a request.");
EventInfo eventInfo = new EventInfo();
eventInfo.SomeID = req.Headers.Contains("SomeID") ? req.Headers.GetValues("SomeID").First() : null;
await outputQueue.AddAsync(eventInfo);
return req.CreateResponse(HttpStatusCode.OK);
}
}
200 HTTP- (Ok), , return, , , :
[FunctionName("SomeEventProcessor")]
[return: Queue("myQueueName", Connection = "myconnection")]
public static EventInfo Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post")]HttpRequestMessage req,
TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
EventInfo eventInfo = new EventInfo();
eventInfo.SomeID = req.Headers.Contains("SomeID") ? req.Headers.GetValues("SomeID").First() : null;
return eventInfo;
}
, Azure Functions 200, , 500, / .