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!!!!!!!"); } }
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!!!!!!!"); } }