public static async Task <IActionResult> Results( [HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req, ILogger log) { log.LogInformation("GetResults: Starting."); string jsonResult = "OK"; try { string storageAccount = Common.Helpers.Common.GetStorageKey(req); string source = Common.Helpers.Common.GetQueryString(req, "name"); DataQC qc = new DataQC(storageAccount); List <QcResult> results = await qc.GetResults(source); jsonResult = JsonConvert.SerializeObject(results, Formatting.Indented); } catch (Exception ex) { log.LogError($"GetResults: Error getting QCResults: {ex}"); return(new BadRequestObjectResult($"Error getting QCResults: {ex}")); } log.LogInformation("GetResults: Complete."); return(new OkObjectResult(jsonResult)); }
public async Task <ActionResult <List <QcResult> > > Get(string source) { List <QcResult> results = new List <QcResult>(); try { string tmpConnString = Request.Headers["AzureStorageConnection"]; DataQC qc = new DataQC(tmpConnString); DataQCParameters qcParms = new DataQCParameters(); qcParms.DataConnector = source; //qcResults = await qc.GetQCRules(qcParms); results = await qc.GetResults(source); } catch (Exception ex) { return(BadRequest($"{ex}")); } return(results); }