Azure Функция: Триггер Blob выдает исключение System.OutOfMemoryException - PullRequest
0 голосов
/ 05 августа 2020

Я получаю исключение System.OutOfMemoryException для Blob Trigger Azure Function. Когда я выполняю локально, он работает нормально.

enter image description here

Blog Trigger Azure Function:

public static class ProcessEvent
    {
        [FunctionName(nameof(ProcessEvent))]
        public static async Task Run([BlobTrigger(BlobStorageContainer.Name + "/{name}",
            Connection = "AzureWebJobsStorage")]
            Stream eventBlob, string name,
            [Inject] ILoggingService loggingService,
            [Inject] IEventProcessorService eventProcessor,
            [Inject] IBlobClient blobClient)
        {
            var logger = new Logger(loggingService);
            try
            {
                logger.Info($"Starting blob job tracker for file name {name}",
                    nameof(ProcessEvent));

                var eventContent = eventBlob.ReadAsString();

                var result = await eventProcessor.HandleProcessor(eventContent, logger);

                if (result)
                {
                    await blobClient.DeleteBlobAsync(BlobStorageContainer.Name, name);
                    logger.Info($"Blob deleted successfully file name: {name}");
                }
                else
                {
                    logger.Warning($"Unable to process blob job for file with name: {name}");
                }
            }
            catch (Exception ex)
            {
                logger.Error($"Unable to process blob job for file with name: {name}", ex,
                    nameof(ProcessEvent));
            }
        }
    }

My App Service Plan:

введите описание изображения здесь

1 Ответ

1 голос
/ 05 августа 2020

Вы можете диагностировать использование памяти в портале-> приложение-функция-> Диагностировать и решить проблему-> Анализ памяти-> Просмотреть полный отчет. enter image description here

It shows the overall percent physical memory usage per instance over the last 24 hours.

https://docs.microsoft.com/en-us/azure/app-service/overview-diagnostics#health -проверки-графики

...