I'm trying to deploy Continuous WebJob (.NET Core 3.1) that have a function with NoAutomaticTrigger attribute. Here is my code.
[NoAutomaticTrigger]
public async Task StartProcessingTest(ILogger logger)
{
await FindActiveContainers(logger);
}
The main method:
static async Task Main(string[] args)
{
_configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", false, true)
.Build();
var builder = new HostBuilder();
builder.ConfigureWebJobs(b => b.AddAzureStorageCoreServices());
builder.ConfigureLogging(b =>
{
b.AddConsole();
});
builder.ConfigureServices((hostContext, services) =>
{
services.AddSingleton(_configuration);
services.BuildServiceProvider();
});
var host = builder.Build();
using (host)
{
await host.RunAsync();
}
}
As I can see the job starts without any exceptions, but for some reasons, the function StartProcessingTest didn't trigger at the start.
question from:
https://stackoverflow.com/questions/66051592/continuous-webjob-dont-start 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…