Azure Webjob not running

We have a webjob project that is a timer based project. It runs locally (offline in VS2022 debugger), but we are using devops to build as a linux target ‘–runtime linux-x64’ and deploying to App_Data/jobs/triggered/Jobnamefolder/appfiles, and when deployed it does not appear to run, or at least there is no evidence the job exists – it is not shown on the webjobs page – more on that later.

The job is basically the following:

using My.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace My.WebJobs
{
    class Program
    {
        static async Task Main()
        {
            var host = new HostBuilder()
                .ConfigureWebJobs(webJobsBuilder =>
                {
                    webJobsBuilder.AddTimers();

                })

                .ConfigureAppConfiguration((context, configBuilder) =>
                {
                    configBuilder.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
                })
                .ConfigureLogging((context, b) =>
                {
                    b.AddConsole();
                })
                .ConfigureServices((context, services) =>
                {
                    var configuration = context.Configuration;
                    var connectionString = configuration["ConnectionStrings:DefaultConnection"];

                    services.AddDbContext<DatabaseService>(options =>
                    {
                        options.UseSqlServer(connectionString);
                    });
                })
                .Build();



            using (host)
            {
                await host.RunAsync();
            }
        }
    }
}

and

using Azure;
using Azure.Communication.Email;
using My.Data;
using My.Domain;
using Microsoft.Azure.WebJobs;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Tokens;

namespace My.WebJobs
{
    public class Functions
    {
        private readonly DatabaseService _databaseService;

        public Functions(DatabaseService databaseService)
        {
            _databaseService = databaseService;
        }

        public void TimerTriggeredFunction([TimerTrigger("0 */1 * * * *")] TimerInfo timerInfo, ILogger logger)
        {
            logger.LogInformation($"Function executed at: {DateTime.Now}");
            SendFeedbackEmails(logger).Wait();
        }

        // this attribute defines what function will be triggered by the web job
        [NoAutomaticTrigger]
        public async Task SendFeedbackEmails(ILogger logger)
        {
...
        }
    }
}

I have 2 functions, one a TimerTrigger and the other flagged with a NoAutomaticTrigger as it is not called Run.

We also have a ‘settings.job’ with “schedule”: {“0 * * * * *”}

Our website runs up fine but the webjob never runs.
I can SSH into the site and confirm the files are in the folder and log stream shows them copying too.
Logs show nothing related to the webjob unless we go to the Azure Portal webjobs page, in which case a background exception occurs:

2024-07-09T00:20:23.0533898Z Exception StackTrace :    at Kudu.Services.Diagnostics.HttpRequestExtensions.ForwardToContainer(String route, HttpRequestMessage request) in /tmp/KuduLite/Kudu.Services/Diagnostics/HttpRequestExtensions.cs:line 22
2024-07-09T00:20:23.0725163Z    at Kudu.Services.Jobs.JobsController.ForwardJobRequestToContainer(String route) in /tmp/KuduLite/Kudu.Services/Jobs/JobsController.cs:line 200
2024-07-09T00:20:23.0725763Z    at Kudu.Services.Jobs.JobsController.ListAllJobs() in /tmp/KuduLite/Kudu.Services/Jobs/JobsController.cs:line 28
2024-07-09T00:20:23.0725790Z    at lambda_method132(Closure , Object , Object[] )
2024-07-09T00:20:23.0725821Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
2024-07-09T00:20:23.0725850Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
2024-07-09T00:20:23.0725876Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2024-07-09T00:20:23.0725962Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
2024-07-09T00:20:23.0725984Z --- End of stack trace from previous location ---
2024-07-09T00:20:23.0726010Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
2024-07-09T00:20:23.0726036Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2024-07-09T00:20:23.0726059Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
2024-07-09T00:20:23.0732366Z --- End of stack trace from previous location ---
2024-07-09T00:20:23.0732406Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2024-07-09T00:20:23.0732430Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
2024-07-09T00:20:23.0732456Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2024-07-09T00:20:23.0732502Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
2024-07-09T00:20:23.0732529Z --- End of stack trace from previous location ---
2024-07-09T00:20:23.0732555Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
2024-07-09T00:20:23.0732582Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
2024-07-09T00:20:23.0732604Z    at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
2024-07-09T00:20:23.0732630Z    at Kudu.Services.Web.Tracing.TraceMiddleware.Invoke(HttpContext context) in /tmp/KuduLite/Kudu.Services.Web/Tracing/TraceMiddleware.cs:line 107
2024-07-09T00:20:23.1611928Z [41m[30mfail[39m[22m[49m: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
2024-07-09T00:20:23.1612508Z       An unhandled exception has occurred while executing the request.
2024-07-09T00:20:23.1612536Z       System.Net.Http.HttpRequestException: Connection refused (169.254.130.5:50555)
2024-07-09T00:20:23.1626364Z        ---> System.Net.Sockets.SocketException (111): Connection refused
2024-07-09T00:20:23.1626787Z          at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 )
2024-07-09T00:20:23.1626817Z          at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs , ValueTask , CancellationToken )
2024-07-09T00:20:23.1626843Z          at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String , Int32 , HttpRequestMessage , Boolean , CancellationToken )
2024-07-09T00:20:23.1626866Z          --- End of inner exception stack trace ---
2024-07-09T00:20:23.1626891Z          at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String , Int32 , HttpRequestMessage , Boolean , CancellationToken )
2024-07-09T00:20:23.1626917Z          at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage , Boolean , CancellationToken )
2024-07-09T00:20:23.1626946Z          at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage , Boolean , CancellationToken )
2024-07-09T00:20:23.1626971Z          at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage )
2024-07-09T00:20:23.1627045Z          at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken )
2024-07-09T00:20:23.1627071Z          at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage , Boolean , CancellationToken )
2024-07-09T00:20:23.1627096Z          at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage , Boolean , Boolean , CancellationToken )
2024-07-09T00:20:23.1627122Z          at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage , Boolean , CancellationToken )
2024-07-09T00:20:23.1627147Z          at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage , Boolean , CancellationToken )
2024-07-09T00:20:23.1627177Z          at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage , HttpCompletionOption , CancellationTokenSource , Boolean , CancellationTokenSource , CancellationToken )
2024-07-09T00:20:23.1627203Z          at Kudu.Services.Web.Tracing.TraceMiddleware.Invoke(HttpContext context) in /tmp/KuduLite/Kudu.Services.Web/Tracing/TraceMiddleware.cs:line 107
2024-07-09T00:20:23.1627229Z          at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
2024-07-09T00:20:23.1627256Z          at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

No documentation appears to quite say ‘how’ the webjob is running – I.e. what hosts the application or starts it.

Any ideas on how to diagnose beyond this point? Anything clearly wrong with what we have?

Thanks!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật