public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
            ILogger log)
        {
            try
            {
                string comic = await ParameterManager.GetParameterValue(req, "comic", (d) => d?.comic);

                OcrCaptionExtractor extractor = new OcrCaptionExtractor(
                    System.Environment.GetEnvironmentVariable(EndpointVariableName, EnvironmentVariableTarget.Process),
                    System.Environment.GetEnvironmentVariable(ApiKeyVariableName, EnvironmentVariableTarget.Process));

                return(new OkObjectResult(await extractor.GetTextFromImage(comic)));
            }
            catch (Exception ex)
            {
                log.LogError(ex, "GetComicContents failed");
                return(new StatusCodeResult(500));
            }
        }
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
            ILogger log)
        {
            try
            {
                string comicId = await ParameterManager.GetParameterValue(req, "comicId", (d) => d?.comicId);

                comicId = ParameterManager.SanitizeParameter(comicId, ParameterManager.ParameterType.Numeric, "");

                XkcdDataCollector collector = new XkcdDataCollector();
                var result = await collector.GetComicInformation(comicId);

                return(new OkObjectResult(result));
            }
            catch (Exception ex)
            {
                log.LogError(ex, "GetComicInformation failed");
                return(new StatusCodeResult(500));
            }
        }