gpt4 book ai didi

Azure函数: Blob Trigger throws System. OutOfMemoryException

转载 作者:行者123 更新时间:2023-12-03 02:36:01 25 4
gpt4 key购买 nike

我收到 Blob 触发器 Azure 函数的 System.OutOfMemoryException 异常。当我在本地执行时,它工作正常。

enter image description here

博客触发Azure功能:

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

我的应用服务计划:

enter image description here

最佳答案

您可以在门户 -> 您的函数应用 -> 诊断和解决问题 -> 内存分析 -> 查看完整报告中诊断内存使用情况。 enter image description here

它显示过去 24 小时内每个实例的总体物理内存使用百分比。

https://learn.microsoft.com/en-us/azure/app-service/overview-diagnostics#health-checkup-graphs

关于Azure函数: Blob Trigger throws System. OutOfMemoryException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63259300/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com