Azure / azure-functions-dotnet-worker

Azure Functions out-of-process .NET language worker
MIT License
429 stars 183 forks source link

Azure functions do not show on Azure portal for Timer triggers. - .Net 8 isolated, ~4 #2254

Closed franklineomollo closed 9 months ago

franklineomollo commented 9 months ago

Description

My timer trigger functions run okay locally but when deployed, the functions do not show and I get this on the logs;

No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).

I run it on .Net 8, the functions_worker_runtime is dotnet-isolated and the extention version is ~4.

Steps to reproduce

Created a timer trigger functions;

local.settings.json

{
    "IsEncrypted": false,
    "Values": {
        "AzureWebJobsStorage": "UseDevelopmentStorage=true",
        "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
    }
}

host.json

{
    "version": "2.0",
    "logging": {
        "applicationInsights": {
            "samplingSettings": {
                "isEnabled": true,
                "excludedTypes": "Request"
            },
            "enableLiveMetricsFilters": true
        }
    }
}
kshyju commented 9 months ago
  1. What deployment method you used? If you try to deploy the app using another deployment method, does that solve the problem for you?
  2. Can you confirm your deployed app has the FUNCTIONS_WORKER_RUNTIME app setting present with correct value ("dotnet-isolated")?. You can check this in the portal Settings->Environment variables->App settings.
  3. What version of nuget packages are you using (Microsoft.Azure.Functions.Worker and Microsoft.Azure.Functions.Worker.Sdk) ?
franklineomollo commented 9 months ago

@kshyju I deployed through Azure DevOps, I have come to the realization that they do appear if I publish directly from Visual Studio but not through pipelines like the other projects I have, I am still not certain why.

FUNCTIONS_WORKER_RUNTIME is indeed okay and set to "dotnet-isolated".

Below is a list of the packages I am currently using;

<ItemGroup>
  <PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.0" />
  <PackageReference Include="Azure.Identity" Version="1.10.4" />
  <PackageReference Include="Azure.Messaging.EventHubs" Version="5.10.0" />
  <PackageReference Include="Azure.Messaging.EventHubs.Processor" Version="5.10.0" />
  <PackageReference Include="Mapster" Version="7.4.0" />
  <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.20.0" />
  <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.EventHubs" Version="6.1.0" />
  <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.5.1" />
  <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.1.0" />
  <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.16.2" />
  <PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.21.0" />
  <PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.0.0" />
  <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
DannyMeister commented 7 months ago

@franklineomollo Can you share if you every found out what caused your pipeline to break your timer trigger? I'm using a common pipeline that sets FUNCTIONS_WORKER_RUNTIME appropriately, and has worked fine on HttpTriggers and DurableOrchestrationContext triggers for other projects as we upgraded to .NET 8/isolated, but no luck so far with TimerTrigger on this project.