Skip to content

Instantly share code, notes, and snippets.

@dontpaniclabsgists
Created August 25, 2017 18:18
Show Gist options
  • Save dontpaniclabsgists/77ea7860645ef13f53dbb228b41251e1 to your computer and use it in GitHub Desktop.
Save dontpaniclabsgists/77ea7860645ef13f53dbb228b41251e1 to your computer and use it in GitHub Desktop.
azure_functions_5_1
#r "System.Configuration"
#r "Newtonsoft.Json"
#r "Microsoft.Azure.WebJobs.Extensions.DocumentDB"
#r "WhateverBillHas.Accessors.dll"
 
using System.Net;
using System.Configuration;
using WhateverBillHas.Accessors;
 
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
    var endpoint = ConfigurationManager.AppSettings["azurefunctionendpoint"];
    var key = ConfigurationManager.AppSettings["azurefunctionkey"];
   
    var factory = new AccessorFactory(endpoint, key);
    var accessor = factory.CreateWardrobeAccessor();
    var w = await accessor.Wardrobes();
    var json = Newtonsoft.Json.JsonConvert.SerializeObject(w);
 
    return req.CreateResponse(HttpStatusCode.OK, json);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment