Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created September 5, 2016 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/ecac896f16c0e57fbfea79a702d7317b to your computer and use it in GitHub Desktop.
Save justinyoo/ecac896f16c0e57fbfea79a702d7317b to your computer and use it in GitHub Desktop.
Testing Azure Functions
using System.Net;
static ServiceLocator locator = new ServiceLocator();
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
log.Info($"C# HTTP trigger function processed a request. RequestUri={req.RequestUri}");
var service = locator.GetService();
var status = locator.GetStatus();
service.Process(req);
status.Status = "Processed";
var res = new HttpResponseMessage(HttpStatusCode.OK) { Content = req.Content };
return await Task.FromResult(res);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment