public async Task <IActionResult> GetMatchingServiceOpportunityReportAsync( #pragma warning disable IDE0060 // Remove unused parameter [HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req, #pragma warning restore IDE0060 // Remove unused parameter ExecutionContext context, ILogger logger) { try { var stopwatch = Stopwatch.StartNew(); logger.LogInformation($"Function {context.FunctionName} triggered"); var result = await _opportunityRepository.GetMatchingServiceOpportunityReportAsync(); stopwatch.Stop(); logger.LogInformation($"Function {context.FunctionName} finished processing\n" + $"\tRows saved: {result.Count}\n" + $"\tTime taken: {stopwatch.ElapsedMilliseconds: #,###}ms"); return(new JsonResult(result)); } catch (Exception e) { var errorMessage = $"Error Executing {context.FunctionName}. Internal Error Message {e}"; logger.LogError(errorMessage); await _functionLogRepository.CreateAsync(new FunctionLog { ErrorMessage = errorMessage, FunctionName = context.FunctionName, RowNumber = -1 }); throw; } }