private static async Task <HttpResponseMessage> Run(HttpRequest req, ILogger log, ExecutionContext ec, string version) { return(await SafeExecutor.Execute(async() => { var cnfg = ConfigUtilities.LoadConfiguration(); var graphRequestUrl = UrlUtilities.Combine(cnfg.GraphBaseUrl, req.Path, req.QueryString.ToString()); var authProvider = FunctionUtilities.GetAuthenticationProvider(req, cnfg); var graphClient = GraphUtilities.GetAuthenticatedClient(cnfg.GraphBaseUrl, version, authProvider); var graphResponse = await GraphUtilities.ExecuteGetRequest(graphClient, graphRequestUrl); return await FunctionUtilities.TransformResponse(req.GetHostUrl(), cnfg.GraphBaseUrl, graphResponse); }, req, log)); }