public async Task Run([TimerTrigger("0 20 5 * * *")] TimerInfo myTimer, ILogger log)
        {
            try
            {
                log.LogInformation($"{nameof(GetDailyFoodLog)} executed at: {DateTime.Now}");
                var dateParameter = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
                log.LogInformation($"Attempting to retrieve Food Log for {dateParameter}");
                var foodResponse = await _fitbitApiService.GetFoodLogs(dateParameter);

                log.LogInformation("Mapping API response to Nutrition object");
                var nutrition = new mdl.Nutrition();
                nutrition.NutritionDate = dateParameter;
                _mapper.Map(foodResponse, nutrition);

                log.LogInformation("Sending mapped Nutrition Log to Service Bus");
                await _serviceBusHelpers.SendMessageToTopic(_configuration["NutritionTopic"], nutrition);
            }
            catch (Exception ex)
            {
                log.LogError($"Exception thrown in {nameof(GetDailyFoodLog)}: {ex.Message}");
                await _serviceBusHelpers.SendMessageToQueue(_configuration["ExceptionQueue"], ex);

                throw ex;
            }
        }
        public async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "FoodLog/{date}")] HttpRequest req,
            ILogger log,
            string date)
        {
            IActionResult result;

            try
            {
                bool isDateValid = _dateValidator.IsNutritionDateValid(date);
                if (isDateValid == false)
                {
                    result = new BadRequestResult();
                    return(result);
                }

                log.LogInformation($"Attempting to manually retrieve Food Log for {date}");
                var foodResponse = await _fitbitApiService.GetFoodLogs(date);

                if (foodResponse == null)
                {
                    result = new NotFoundResult();
                    return(result);
                }

                log.LogInformation("Mapping API Response to Nutrition object");
                var nutrition = new mdl.Nutrition();
                nutrition.NutritionDate = date;
                _mapper.Map(foodResponse, nutrition);

                log.LogInformation("Sending mapped Nutrition Log to Service Bus");
                await _serviceBusHelpers.SendMessageToTopic(_configuration["NutritionTopic"], nutrition);

                result = new OkResult();
            }
            catch (Exception ex)
            {
                log.LogError($"Exception thrown in {nameof(RetrieveManualFoodLog)}: {ex.Message}");
                await _serviceBusHelpers.SendMessageToQueue(_configuration["ExceptionQueue"], ex);

                result = new StatusCodeResult(StatusCodes.Status500InternalServerError);
            }

            return(result);
        }