Referencing these instructions:
I've created a .NET 5.0 isolated function, all appears ok initially. When I run it, it just times out:
2021-04-01T12:16:43.912 [Information] Executing 'Functions.MediaUploadProcessorFunction' (Reason='New blob detected: uploads/32~Flowers.png', Id=729ad0ad-0668-4d88-84de-5c623f8a01c1)
2021-04-01T12:16:44.068 [Information] Trigger Details: MessageId: 759690bc-4ca7-4007-8084-ff1bf01de571, DequeueCount: 1, InsertionTime: 2021-04-01T12:16:42.000+00:00, BlobCreated: 2021-04-01T12:16:34.000+00:00, BlobLastModified: 2021-04-01T12:16:34.000+00:00
2021-04-01T12:21:19.917 [Information] Host Status: {"id": "myfunctionsdev","state": "Running","version": "3.0.15405.0","versionDetails": "3.0.15405 Commit hash: c696322564f1f9dc9557bfa495c0485ddf71eeef","platformVersion": "92.0.7.77","instanceId": "05815e0557966c201dc16275542526907206bb509874c0c62f71bc49fbcaa301","computerName": "RD281878F6217D","processUptime": 327992}275542526907206bb509874c0c62f71bc49fbcaa301","computerName": "RD281878F6217D","processUptime": 327992}tion' (Id: '729ad0ad-0668-4d88-84de-5c623f8a01c1'). Initiating cancellation.'Functions.MediaUploadProcessorFunction' (Id: '729ad0ad-0668-4d88-84de-5c623f8a01c1'). Initiating cancellation.4de-5c623f8a01c1, Duration=301517ms)Timeout value of 00:05:00 was exceeded by function: Functions.MediaUploadProcessorFunction, Duration=301517ms)Timeout value of 00:05:00 was exceeded by function: Functions.MediaUploadProcessorFunction
2021-04-01T12:21:46.469 [Warning] A function timeout has occurred. Restarting worker process executing invocationId '729ad0ad-0668-4d88-84de-5c623f8a01c1'.
2021-04-01T12:21:46.472 [Information] Restarting channel '6c9e4a92-c2d5-48c4-9474-7d3e70f7a6d4' that is executing invocation '729ad0ad-0668-4d88-84de-5c623f8
It detects the function and the trigger fires, but the actual function does not run (the debugger does NOT attach).
[Function(nameof(MediaUploadProcessorFunction))]
public async Task Run([BlobTrigger(containerName + "/{name}", Connection = "AzureWebJobsStorage")] Stream myBlob, string name, ILogger log)
{
System.Diagnostics.Debugger.Launch();
System.Diagnostics.Debugger.Break();
log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
}
public MediaUploadProcessorFunction(IEmailService emailService, IMediaRepository mediaRepository, IOptions<ErrorEmailOptions> errorEmailOptions, IOptions<ValuesOptions> valuesOptions, IGroupRepository groupRepository)
{
System.Diagnostics.Debugger.Launch();
System.Diagnostics.Debugger.Break();
_emailService = emailService ?? throw new ArgumentNullException(nameof(emailService));
_mediaRepository = mediaRepository ?? throw new ArgumentNullException(nameof(mediaRepository));
_errorEmailOptions = errorEmailOptions?.Value ?? throw new ArgumentNullException(nameof(errorEmailOptions));
_values = valuesOptions?.Value ?? throw new ArgumentNullException(nameof(valuesOptions));
_groupRepository = groupRepository ?? throw new ArgumentNullException(nameof(groupRepository));
}
and the start up (the debugger does attach OK):
static Task Main(string[] args)
{
System.Diagnostics.Debugger.Launch();
var config = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
var host = new HostBuilder()
.ConfigureAppConfiguration(configurationBuilder =>
{
configurationBuilder.AddCommandLine(args);
})
.ConfigureFunctionsWorkerDefaults()
.ConfigureServices(services =>
{
services.AddLogging();
services.Configure<ValuesOptions>(config.GetSection("Values"));
services.AddScoped<IMediaRepository, MediaRepository>();
services.Configure<ErrorEmailOptions>(config.GetSection("ErrorEmail"));
services.AddScoped<IEmailService, EmailService>();
services.AddScoped<IGroupRepository, GroupRepository>();
services.AddDbContext<Context>(opts =>
{
var conn = config.GetConnectionString("Context");
opts.UseSqlServer(conn);
});
})
.Build();
return host.RunAsync();
}
Anybody have any ideas I can try?