Reputation: 3149
I am getting System.OutOfMemoryException exception for Blob Trigger Azure Function. When I am executing locally it is working fine.
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:
Upvotes: 1
Views: 638
Reputation: 3398
You can diagnose the memory usage in portal->your function app->Diagnose and solve problem->Memory Analysis->View Full Report.
It shows the overall percent physical memory usage per instance over the last 24 hours.
https://learn.microsoft.com/en-us/azure/app-service/overview-diagnostics#health-checkup-graphs
Upvotes: 1