From 356c19392b2470dbfc3ffbeb88d87d417bd0cf3b Mon Sep 17 00:00:00 2001 From: Henry van der Vegte Date: Thu, 25 May 2023 12:02:12 +0200 Subject: [PATCH] [IngestionClient] Move transcription analytics from transcription processor to orchestrator (#1956) --- .../Enums/TranscriptionAnalyticsJobStatus.cs | 2 +- .../TranscriptionStartedMessageExtensions.cs | 5 +- .../Language/AnalyzeConversationsProvider.cs | 4 +- .../TextAnalytics/TextAnalyticsProvider.cs | 6 +- .../TranscriptionAnalyticsOrchestrator.cs | 169 ++++++++++++++++++ .../TranscriptionProcessor.cs | 134 ++++---------- .../Setup/ArmTemplateBatch.json | 2 +- .../Setup/ArmTemplateRealtime.json | 2 +- .../ingestion-client/Tests/EndToEndTests.cs | 2 +- 9 files changed, 206 insertions(+), 120 deletions(-) rename samples/ingestion/ingestion-client/FetchTranscription/{ => TranscriptionAnalytics}/Language/AnalyzeConversationsProvider.cs (99%) rename samples/ingestion/ingestion-client/FetchTranscription/{ => TranscriptionAnalytics}/TextAnalytics/TextAnalyticsProvider.cs (99%) create mode 100644 samples/ingestion/ingestion-client/FetchTranscription/TranscriptionAnalytics/TranscriptionAnalyticsOrchestrator.cs diff --git a/samples/ingestion/ingestion-client/Connector/Enums/TranscriptionAnalyticsJobStatus.cs b/samples/ingestion/ingestion-client/Connector/Enums/TranscriptionAnalyticsJobStatus.cs index 4109ca3bd..59895dd29 100644 --- a/samples/ingestion/ingestion-client/Connector/Enums/TranscriptionAnalyticsJobStatus.cs +++ b/samples/ingestion/ingestion-client/Connector/Enums/TranscriptionAnalyticsJobStatus.cs @@ -8,7 +8,7 @@ namespace Connector.Enums public enum TranscriptionAnalyticsJobStatus { None, - NotStarted, + NotSubmitted, Running, Completed } diff --git a/samples/ingestion/ingestion-client/FetchTranscription/Extensions/TranscriptionStartedMessageExtensions.cs b/samples/ingestion/ingestion-client/FetchTranscription/Extensions/TranscriptionStartedMessageExtensions.cs index 722e85dc6..a5268df99 100644 --- a/samples/ingestion/ingestion-client/FetchTranscription/Extensions/TranscriptionStartedMessageExtensions.cs +++ b/samples/ingestion/ingestion-client/FetchTranscription/Extensions/TranscriptionStartedMessageExtensions.cs @@ -12,11 +12,8 @@ namespace FetchTranscriptionFunction using Connector; using Connector.Enums; - using Language; using Microsoft.Extensions.Logging; - using TextAnalytics; - public static class TranscriptionStartedMessageExtensions { public static async Task GetTranscriptionAnalyticsJobsStatusAsync( @@ -47,7 +44,7 @@ public static async Task GetTranscriptionAnalyt return TranscriptionAnalyticsJobStatus.Completed; } - return TranscriptionAnalyticsJobStatus.NotStarted; + return TranscriptionAnalyticsJobStatus.NotSubmitted; } } } diff --git a/samples/ingestion/ingestion-client/FetchTranscription/Language/AnalyzeConversationsProvider.cs b/samples/ingestion/ingestion-client/FetchTranscription/TranscriptionAnalytics/Language/AnalyzeConversationsProvider.cs similarity index 99% rename from samples/ingestion/ingestion-client/FetchTranscription/Language/AnalyzeConversationsProvider.cs rename to samples/ingestion/ingestion-client/FetchTranscription/TranscriptionAnalytics/Language/AnalyzeConversationsProvider.cs index 9e1f4128d..627e81601 100644 --- a/samples/ingestion/ingestion-client/FetchTranscription/Language/AnalyzeConversationsProvider.cs +++ b/samples/ingestion/ingestion-client/FetchTranscription/TranscriptionAnalytics/Language/AnalyzeConversationsProvider.cs @@ -3,7 +3,7 @@ // Licensed under the MIT license. See LICENSE.md file in the project root for full license information. // -namespace Language +namespace FetchTranscriptionFunction { using System; using System.Collections.Generic; @@ -20,8 +20,6 @@ namespace Language using Connector.Serializable.Language.Conversations; using Connector.Serializable.TranscriptionStartedServiceBusMessage; - using FetchTranscriptionFunction; - using Microsoft.Extensions.Logging; using Newtonsoft.Json; diff --git a/samples/ingestion/ingestion-client/FetchTranscription/TextAnalytics/TextAnalyticsProvider.cs b/samples/ingestion/ingestion-client/FetchTranscription/TranscriptionAnalytics/TextAnalytics/TextAnalyticsProvider.cs similarity index 99% rename from samples/ingestion/ingestion-client/FetchTranscription/TextAnalytics/TextAnalyticsProvider.cs rename to samples/ingestion/ingestion-client/FetchTranscription/TranscriptionAnalytics/TextAnalytics/TextAnalyticsProvider.cs index cf120b029..cbd38e094 100644 --- a/samples/ingestion/ingestion-client/FetchTranscription/TextAnalytics/TextAnalyticsProvider.cs +++ b/samples/ingestion/ingestion-client/FetchTranscription/TranscriptionAnalytics/TextAnalytics/TextAnalyticsProvider.cs @@ -3,7 +3,7 @@ // Licensed under the MIT license. See LICENSE.md file in the project root for full license information. // -namespace TextAnalytics +namespace FetchTranscriptionFunction { using System; using System.Collections.Generic; @@ -18,10 +18,6 @@ namespace TextAnalytics using Connector.Enums; using Connector.Serializable.TranscriptionStartedServiceBusMessage; - using FetchTranscriptionFunction; - - using Language; - using Microsoft.Extensions.Logging; using static Connector.Serializable.TranscriptionStartedServiceBusMessage.TextAnalyticsRequest; diff --git a/samples/ingestion/ingestion-client/FetchTranscription/TranscriptionAnalytics/TranscriptionAnalyticsOrchestrator.cs b/samples/ingestion/ingestion-client/FetchTranscription/TranscriptionAnalytics/TranscriptionAnalyticsOrchestrator.cs new file mode 100644 index 000000000..7be45dc93 --- /dev/null +++ b/samples/ingestion/ingestion-client/FetchTranscription/TranscriptionAnalytics/TranscriptionAnalyticsOrchestrator.cs @@ -0,0 +1,169 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE.md file in the project root for full license information. +// + +namespace FetchTranscription.TranscriptionAnalytics +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + + using Connector; + using Connector.Enums; + using Connector.Serializable.TranscriptionStartedServiceBusMessage; + + using FetchTranscriptionFunction; + using Microsoft.Extensions.Logging; + + using static Connector.Serializable.TranscriptionStartedServiceBusMessage.TextAnalyticsRequest; + + public sealed class TranscriptionAnalyticsOrchestrator + { + private readonly TextAnalyticsProvider textAnalyticsProvider; + private readonly AnalyzeConversationsProvider analyzeConversationsProvider; + + public TranscriptionAnalyticsOrchestrator( + string locale, + ILogger logger) + { + var textAnalyticsKey = FetchTranscriptionEnvironmentVariables.TextAnalyticsKey; + var textAnalyticsEndpoint = FetchTranscriptionEnvironmentVariables.TextAnalyticsEndpoint; + var textAnalyticsInfoProvided = !string.IsNullOrEmpty(textAnalyticsKey) && !string.IsNullOrEmpty(textAnalyticsEndpoint); + + this.analyzeConversationsProvider = textAnalyticsInfoProvided ? new AnalyzeConversationsProvider(locale, textAnalyticsKey, textAnalyticsEndpoint, logger) : null; + this.textAnalyticsProvider = textAnalyticsInfoProvided ? new TextAnalyticsProvider(locale, textAnalyticsKey, textAnalyticsEndpoint, logger) : null; + } + + public async Task GetTranscriptionAnalyticsJobsStatusAsync(TranscriptionStartedMessage transcriptionStartedMessage) + { + _ = transcriptionStartedMessage ?? throw new ArgumentNullException(nameof(transcriptionStartedMessage)); + + if (this.textAnalyticsProvider == null && this.analyzeConversationsProvider == null) + { + return TranscriptionAnalyticsJobStatus.None; + } + + var textAnalyticsRequestCompleted = this.textAnalyticsProvider != null ? await this.textAnalyticsProvider.TextAnalyticsRequestsCompleted(transcriptionStartedMessage.AudioFileInfos).ConfigureAwait(false) : true; + var conversationalAnalyticsRequestCompleted = this.analyzeConversationsProvider != null ? await this.analyzeConversationsProvider.ConversationalRequestsCompleted(transcriptionStartedMessage.AudioFileInfos).ConfigureAwait(false) : true; + + if (!textAnalyticsRequestCompleted || !conversationalAnalyticsRequestCompleted) + { + return TranscriptionAnalyticsJobStatus.Running; + } + + // if the message already contains text analytics requests and all are in terminal state, treat jobs as completed: + var containsTextAnalyticsRequest = transcriptionStartedMessage.AudioFileInfos.Where(audioFileInfo => audioFileInfo.TextAnalyticsRequests != null).Any(); + if (containsTextAnalyticsRequest) + { + return TranscriptionAnalyticsJobStatus.Completed; + } + + return TranscriptionAnalyticsJobStatus.NotSubmitted; + } + + public async Task> AddTranscriptionAnalyticsResultsToTranscripts(Dictionary speechTranscriptMappings) + { + _ = speechTranscriptMappings ?? throw new ArgumentNullException(nameof(speechTranscriptMappings)); + + var errors = new List(); + foreach (var speechTranscriptMapping in speechTranscriptMappings) + { + var speechTranscript = speechTranscriptMapping.Value; + var audioFileInfo = speechTranscriptMapping.Key; + var fileName = audioFileInfo.FileName; + if (FetchTranscriptionEnvironmentVariables.PiiRedactionSetting != PiiRedactionSetting.None) + { + speechTranscript.RecognizedPhrases.ToList().ForEach(phrase => + { + if (phrase.NBest != null && phrase.NBest.Any()) + { + var firstNBest = phrase.NBest.First(); + phrase.NBest = new[] { firstNBest }; + } + }); + } + + var textAnalyticsErrors = new List(); + + if (audioFileInfo.TextAnalyticsRequests.AudioLevelRequests?.Any() == true) + { + var audioLevelErrors = await this.textAnalyticsProvider.AddAudioLevelEntitiesAsync(audioFileInfo.TextAnalyticsRequests.AudioLevelRequests.Select(request => request.Id), speechTranscript).ConfigureAwait(false); + textAnalyticsErrors.AddRange(audioLevelErrors); + } + + if (audioFileInfo.TextAnalyticsRequests.UtteranceLevelRequests?.Any() == true) + { + var utteranceLevelErrors = await this.textAnalyticsProvider.AddUtteranceLevelEntitiesAsync(audioFileInfo.TextAnalyticsRequests.UtteranceLevelRequests.Select(request => request.Id), speechTranscript).ConfigureAwait(false); + textAnalyticsErrors.AddRange(utteranceLevelErrors); + } + + if (audioFileInfo.TextAnalyticsRequests.ConversationRequests?.Any() == true) + { + var conversationalAnalyticsErrors = await this.analyzeConversationsProvider.AddConversationalEntitiesAsync(audioFileInfo.TextAnalyticsRequests.ConversationRequests.Select(request => request.Id), speechTranscript).ConfigureAwait(false); + textAnalyticsErrors.AddRange(conversationalAnalyticsErrors); + } + + if (textAnalyticsErrors.Any()) + { + var distinctErrors = textAnalyticsErrors.Distinct(); + var errorMessage = $"File {(string.IsNullOrEmpty(fileName) ? "unknown" : fileName)}:\n{string.Join('\n', distinctErrors)}"; + errors.Add(errorMessage); + } + } + + return errors; + } + + public async Task> SubmitTranscriptionAnalyticsJobsAndAddToAudioFileInfos(Dictionary speechTranscriptMappings) + { + _ = speechTranscriptMappings ?? throw new ArgumentNullException(nameof(speechTranscriptMappings)); + + var errors = new List(); + foreach (var speechTranscriptMapping in speechTranscriptMappings) + { + var speechTranscript = speechTranscriptMapping.Value; + var audioFileInfo = speechTranscriptMapping.Key; + + var fileName = audioFileInfo.FileName; + + if (speechTranscript.RecognizedPhrases != null && speechTranscript.RecognizedPhrases.All(phrase => phrase.RecognitionStatus.Equals("Success", StringComparison.Ordinal))) + { + var textAnalyticsErrors = new List(); + + (var utteranceLevelJobIds, var utteranceLevelErrors) = await this.textAnalyticsProvider.SubmitUtteranceLevelRequests( + speechTranscript, + FetchTranscriptionEnvironmentVariables.SentimentAnalysisSetting).ConfigureAwait(false); + + var utteranceLevelRequests = utteranceLevelJobIds?.Select(jobId => new TextAnalyticsRequest(jobId, TextAnalyticsRequestStatus.Running)); + textAnalyticsErrors.AddRange(utteranceLevelErrors); + + (var audioLevelJobIds, var audioLevelErrors) = await this.textAnalyticsProvider.SubmitAudioLevelRequests( + speechTranscript, + FetchTranscriptionEnvironmentVariables.SentimentAnalysisSetting, + FetchTranscriptionEnvironmentVariables.PiiRedactionSetting).ConfigureAwait(false); + + var audioLevelRequests = audioLevelJobIds?.Select(jobId => new TextAnalyticsRequest(jobId, TextAnalyticsRequestStatus.Running)); + textAnalyticsErrors.AddRange(audioLevelErrors); + + (var conversationJobIds, var conversationErrors) = await this.analyzeConversationsProvider.SubmitAnalyzeConversationsRequestAsync(speechTranscript).ConfigureAwait(false); + + var conversationalRequests = conversationJobIds?.Select(jobId => new TextAnalyticsRequest(jobId, TextAnalyticsRequestStatus.Running)); + textAnalyticsErrors.AddRange(conversationErrors); + + audioFileInfo.TextAnalyticsRequests = new TextAnalyticsRequests(utteranceLevelRequests, audioLevelRequests, conversationalRequests); + + if (textAnalyticsErrors.Any()) + { + var distinctErrors = textAnalyticsErrors.Distinct(); + var errorMessage = $"File {(string.IsNullOrEmpty(fileName) ? "unknown" : fileName)}:\n{string.Join('\n', distinctErrors)}"; + errors.Add(errorMessage); + } + } + } + + return errors; + } + } +} diff --git a/samples/ingestion/ingestion-client/FetchTranscription/TranscriptionProcessor.cs b/samples/ingestion/ingestion-client/FetchTranscription/TranscriptionProcessor.cs index 1fdd15bf5..ddee3d00d 100644 --- a/samples/ingestion/ingestion-client/FetchTranscription/TranscriptionProcessor.cs +++ b/samples/ingestion/ingestion-client/FetchTranscription/TranscriptionProcessor.cs @@ -19,14 +19,12 @@ namespace FetchTranscriptionFunction using Connector.Database; using Connector.Enums; using Connector.Serializable.TranscriptionStartedServiceBusMessage; - - using Language; + using global::FetchTranscription.TranscriptionAnalytics; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Newtonsoft.Json; - using TextAnalytics; using static Connector.Serializable.TranscriptionStartedServiceBusMessage.TextAnalyticsRequest; public class TranscriptionProcessor @@ -314,20 +312,24 @@ await StorageConnectorInstance.MoveFileAsync( } } - private async Task ProcessSucceededTranscriptionAsync(string transcriptionLocation, string subscriptionKey, TranscriptionStartedMessage serviceBusMessage, string jobName, ILogger log) + private static async Task WriteErrorReportAsync(string errorString, string jobName, ILogger logger) { - log.LogInformation($"Got succeeded transcription for job {jobName}"); + var errorTxtname = $"jobs/{jobName}.txt"; - var textAnalyticsKey = FetchTranscriptionEnvironmentVariables.TextAnalyticsKey; - var textAnalyticsEndpoint = FetchTranscriptionEnvironmentVariables.TextAnalyticsEndpoint; - var textAnalyticsInfoProvided = !string.IsNullOrEmpty(textAnalyticsKey); - - var conversationsAnalysisProvider = textAnalyticsInfoProvided ? new AnalyzeConversationsProvider(serviceBusMessage.Locale, textAnalyticsKey, textAnalyticsEndpoint, log) : null; - var textAnalyticsProvider = textAnalyticsInfoProvided ? new TextAnalyticsProvider(serviceBusMessage.Locale, textAnalyticsKey, textAnalyticsEndpoint, log) : null; + await StorageConnectorInstance.WriteTextFileToBlobAsync( + errorString, + FetchTranscriptionEnvironmentVariables.ErrorReportOutputContainer, + errorTxtname, + logger).ConfigureAwait(false); + } - var transcriptionAnalyticsJobsStatus = await serviceBusMessage.GetTranscriptionAnalyticsJobsStatusAsync(textAnalyticsProvider, conversationsAnalysisProvider, log).ConfigureAwait(false); + private async Task ProcessSucceededTranscriptionAsync(string transcriptionLocation, string subscriptionKey, TranscriptionStartedMessage serviceBusMessage, string jobName, ILogger log) + { + log.LogInformation($"Got succeeded transcription for job {jobName}"); - if (transcriptionAnalyticsJobsStatus == TranscriptionAnalyticsJobStatus.Running) + var transcriptionAnalyticsOrchestrator = new TranscriptionAnalyticsOrchestrator(serviceBusMessage.Locale, log); + var transcriptionAnalyticsJobStatus = await transcriptionAnalyticsOrchestrator.GetTranscriptionAnalyticsJobsStatusAsync(serviceBusMessage).ConfigureAwait(false); + if (transcriptionAnalyticsJobStatus == TranscriptionAnalyticsJobStatus.Running) { // If transcription analytics request is still running, re-queue message and get status again after X minutes: log.LogInformation($"Transcription analytics requests still running for job {jobName} - re-queueing message."); @@ -381,97 +383,27 @@ private async Task ProcessSucceededTranscriptionAsync(string transcriptionLocati } } - if (transcriptionAnalyticsJobsStatus == TranscriptionAnalyticsJobStatus.Completed) + if (transcriptionAnalyticsJobStatus == TranscriptionAnalyticsJobStatus.Completed) { - foreach (var speechTranscriptMapping in speechTranscriptMappings) - { - var speechTranscript = speechTranscriptMapping.Value; - var audioFileInfo = speechTranscriptMapping.Key; - var fileName = audioFileInfo.FileName; - if (FetchTranscriptionEnvironmentVariables.PiiRedactionSetting != PiiRedactionSetting.None) - { - speechTranscript.RecognizedPhrases.ToList().ForEach(phrase => - { - if (phrase.NBest != null && phrase.NBest.Any()) - { - var firstNBest = phrase.NBest.First(); - phrase.NBest = new[] { firstNBest }; - } - }); - } - - var textAnalyticsErrors = new List(); - - if (audioFileInfo.TextAnalyticsRequests.AudioLevelRequests?.Any() == true) - { - var audioLevelErrors = await textAnalyticsProvider.AddAudioLevelEntitiesAsync(audioFileInfo.TextAnalyticsRequests.AudioLevelRequests.Select(request => request.Id), speechTranscript).ConfigureAwait(false); - textAnalyticsErrors.AddRange(audioLevelErrors); - } - - if (audioFileInfo.TextAnalyticsRequests.UtteranceLevelRequests?.Any() == true) - { - var utteranceLevelErrors = await textAnalyticsProvider.AddUtteranceLevelEntitiesAsync(audioFileInfo.TextAnalyticsRequests.UtteranceLevelRequests.Select(request => request.Id), speechTranscript).ConfigureAwait(false); - textAnalyticsErrors.AddRange(utteranceLevelErrors); - } - - if (audioFileInfo.TextAnalyticsRequests.ConversationRequests?.Any() == true) - { - var conversationalAnalyticsErrors = await conversationsAnalysisProvider.AddConversationalEntitiesAsync(audioFileInfo.TextAnalyticsRequests.ConversationRequests.Select(request => request.Id), speechTranscript).ConfigureAwait(false); - textAnalyticsErrors.AddRange(conversationalAnalyticsErrors); - } - - if (textAnalyticsErrors.Any()) - { - var distinctErrors = textAnalyticsErrors.Distinct(); - var errorMessage = $"File {(string.IsNullOrEmpty(fileName) ? "unknown" : fileName)}:\n{string.Join('\n', distinctErrors)}"; + var errors = await transcriptionAnalyticsOrchestrator.AddTranscriptionAnalyticsResultsToTranscripts(speechTranscriptMappings).ConfigureAwait(false); - generalErrorsStringBuilder.AppendLine(errorMessage); - } + foreach (var error in errors) + { + generalErrorsStringBuilder.AppendLine(error); } } - else if (transcriptionAnalyticsJobsStatus == TranscriptionAnalyticsJobStatus.NotStarted) + else if (transcriptionAnalyticsJobStatus == TranscriptionAnalyticsJobStatus.NotSubmitted) { - foreach (var speechTranscriptMapping in speechTranscriptMappings) + var errors = await transcriptionAnalyticsOrchestrator.SubmitTranscriptionAnalyticsJobsAndAddToAudioFileInfos(speechTranscriptMappings).ConfigureAwait(false); + foreach (var error in errors) { - var speechTranscript = speechTranscriptMapping.Value; - var audioFileInfo = speechTranscriptMapping.Key; - - var fileName = audioFileInfo.FileName; - - if (speechTranscript.RecognizedPhrases != null && speechTranscript.RecognizedPhrases.All(phrase => phrase.RecognitionStatus.Equals("Success", StringComparison.Ordinal))) - { - var textAnalyticsErrors = new List(); - - (var utteranceLevelJobIds, var utteranceLevelErrors) = await textAnalyticsProvider.SubmitUtteranceLevelRequests( - speechTranscript, - FetchTranscriptionEnvironmentVariables.SentimentAnalysisSetting).ConfigureAwait(false); - - var utteranceLevelRequests = utteranceLevelJobIds?.Select(jobId => new TextAnalyticsRequest(jobId, TextAnalyticsRequestStatus.Running)); - textAnalyticsErrors.AddRange(utteranceLevelErrors); - - (var audioLevelJobIds, var audioLevelErrors) = await textAnalyticsProvider.SubmitAudioLevelRequests( - speechTranscript, - FetchTranscriptionEnvironmentVariables.SentimentAnalysisSetting, - FetchTranscriptionEnvironmentVariables.PiiRedactionSetting).ConfigureAwait(false); - - var audioLevelRequests = audioLevelJobIds?.Select(jobId => new TextAnalyticsRequest(jobId, TextAnalyticsRequestStatus.Running)); - textAnalyticsErrors.AddRange(audioLevelErrors); - - (var conversationJobIds, var conversationErrors) = await conversationsAnalysisProvider.SubmitAnalyzeConversationsRequestAsync(speechTranscript).ConfigureAwait(false); - - var conversationalRequests = conversationJobIds?.Select(jobId => new TextAnalyticsRequest(jobId, TextAnalyticsRequestStatus.Running)); - textAnalyticsErrors.AddRange(conversationErrors); - - audioFileInfo.TextAnalyticsRequests = new TextAnalyticsRequests(utteranceLevelRequests, audioLevelRequests, conversationalRequests); - - if (textAnalyticsErrors.Any()) - { - var distinctErrors = textAnalyticsErrors.Distinct(); - var errorMessage = $"File {(string.IsNullOrEmpty(fileName) ? "unknown" : fileName)}:\n{string.Join('\n', distinctErrors)}"; + generalErrorsStringBuilder.AppendLine(error); + } - generalErrorsStringBuilder.AppendLine(errorMessage); - } - } + var textAnalyticsSubmitErrors = generalErrorsStringBuilder.ToString(); + if (!string.IsNullOrEmpty(textAnalyticsSubmitErrors)) + { + await WriteErrorReportAsync(textAnalyticsSubmitErrors, jobName, log).ConfigureAwait(false); } log.LogInformation($"Added text analytics requests to service bus message - re-queueing message."); @@ -564,13 +496,7 @@ await this.databaseContext.StoreTranscriptionAsync( var generalErrors = generalErrorsStringBuilder.ToString(); if (!string.IsNullOrEmpty(generalErrors)) { - var errorTxtname = $"jobs/{jobName}.txt"; - - await StorageConnectorInstance.WriteTextFileToBlobAsync( - generalErrors, - FetchTranscriptionEnvironmentVariables.ErrorReportOutputContainer, - errorTxtname, - log).ConfigureAwait(false); + await WriteErrorReportAsync(generalErrors, jobName, log).ConfigureAwait(false); } var reportFile = transcriptionFiles.Values.Where(t => t.Kind == TranscriptionFileKind.TranscriptionReport).FirstOrDefault(); diff --git a/samples/ingestion/ingestion-client/Setup/ArmTemplateBatch.json b/samples/ingestion/ingestion-client/Setup/ArmTemplateBatch.json index daae805c1..9eaa1be97 100644 --- a/samples/ingestion/ingestion-client/Setup/ArmTemplateBatch.json +++ b/samples/ingestion/ingestion-client/Setup/ArmTemplateBatch.json @@ -203,7 +203,7 @@ } }, "variables": { - "Version": "v2.0.8", + "Version": "v2.0.9", "AudioInputContainer": "audio-input", "AudioProcessedContainer": "audio-processed", "ErrorFilesOutputContainer": "audio-failed", diff --git a/samples/ingestion/ingestion-client/Setup/ArmTemplateRealtime.json b/samples/ingestion/ingestion-client/Setup/ArmTemplateRealtime.json index ab52499d3..39467305b 100644 --- a/samples/ingestion/ingestion-client/Setup/ArmTemplateRealtime.json +++ b/samples/ingestion/ingestion-client/Setup/ArmTemplateRealtime.json @@ -123,7 +123,7 @@ } }, "variables": { - "Version": "v2.0.8", + "Version": "v2.0.9", "AudioInputContainer": "audio-input", "AudioProcessedContainer": "audio-processed", "ErrorFilesOutputContainer": "audio-failed", diff --git a/samples/ingestion/ingestion-client/Tests/EndToEndTests.cs b/samples/ingestion/ingestion-client/Tests/EndToEndTests.cs index 12521c5ff..18ccc9532 100644 --- a/samples/ingestion/ingestion-client/Tests/EndToEndTests.cs +++ b/samples/ingestion/ingestion-client/Tests/EndToEndTests.cs @@ -15,7 +15,7 @@ namespace Tests using Connector.Serializable.Language.Conversations; using Connector.Serializable.TranscriptionStartedServiceBusMessage; - using Language; + using FetchTranscriptionFunction; using Microsoft.CognitiveServices.Speech; using Microsoft.Extensions.Logging;