public async Task Run()

in src/Services/Infection/Infection.FnApp/Functions/ContactTracingTrigger.cs [76:117]


        public async Task Run(
            [BlobTrigger("%BlobPath%/{name}", Connection = "BlobConnection")]Stream myBlob,
            string name,
            IDictionary<string, string> metadata,
            [ServiceBus("%ContactsTopicName%", Connection = "ContactsTopicSendConnection")] MessageSender messagesQueue)
        {
            logger.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");

            try
            {
                // extract userToken
                var userToken = string.Empty;
                metadata?.TryGetValue(UserToken, out userToken);

                // extract meetings
                var reader = new StreamReader(myBlob);
                var jsonContent = await reader.ReadToEndAsync();
                JObject jsonObject = JObject.Parse(jsonContent);

                IList<Meeting> meetings = null;
                JToken trgArray = jsonObject.Descendants().First(d => d is JArray);
                if (trgArray != null && trgArray.Type == JTokenType.Array)
                {
                    meetings = JsonConvert.DeserializeObject<List<Meeting>>(trgArray.ToString());
                }

                if (meetings == null)
                {
                    throw new Exception("Invalid meeting list format");
                }

                logger.LogInformation("UserToken: {userToken}. Received {meetingsCount} meetings", userToken, meetings.Count);

                contactTracingService.MessageSender = messagesQueue;
                await contactTracingService.ProcessContactList(userToken, meetings);
            }
            catch (Exception ex)
            {
                logger.LogError(ex, $"Unhandled exception: {ex.Message}");
                throw;
            }
        }