Created
August 25, 2017 18:18
-
-
Save dontpaniclabsgists/77ea7860645ef13f53dbb228b41251e1 to your computer and use it in GitHub Desktop.
azure_functions_5_1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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