Ejemplo n.º 1
0
        public async Task Run(
            [EventGridTrigger] EventGridEvent eventGridEvent, ILogger logger)
        {
            logger.LogInformation($"Started the evaluation of the gift");

            StorageBlobCreatedEventData storageBlobCreatedEventData =
                ((JObject)eventGridEvent.Data).ToObject <StorageBlobCreatedEventData>();

            string blobUrl = storageBlobCreatedEventData.Url;

            string fileName = Path.GetFileName(blobUrl);

            logger.LogInformation($"Evaluating Gift {fileName}");

            var isGiftProperlyWrapped = await _computerVisionHelper.IsPresentPerfectlyWrapped(blobUrl);

            if (!isGiftProperlyWrapped)
            {
                logger.LogError($"Gift Not Correctly wrapped. SANTA NOT HAPPY!!!!!!!!!!!!!!");
            }
            else
            {
                logger.LogInformation($"Gift is correctly wrapped. SANTA HAPPY!!!!!!!");
            }
        }
Ejemplo n.º 2
0
        public async Task Run(
            [BlobTrigger("analyzegiftwithblobtrigger/{name}", Connection = "SantasGiftBlobTriggerContainer")]
            Stream blob, string name, ILogger logger)
        {
            logger.LogInformation($"Analyzing Gift:{name}");

            var isGiftProperlyWrapped = await _computerVisionHelper.IsPresentPerfectlyWrapped(blob);

            if (!isGiftProperlyWrapped)
            {
                logger.LogError($"Gift Not Correctly wrapped. SANTA NOT HAPPY!!!!!!!!!!!!!!");
            }
            else
            {
                logger.LogInformation($"Gift is correctly wrapped. SANTA HAPPY!!!!!!!");
            }
        }