Gradle@3 fails when building azure function TimerTrigger in Java 17

Hi

I have a wierd problem.

I am using Gradle@3 to build my azure timer trigger function:

  - task: Gradle@3
    inputs:
      gradleWrapperFile: 'gradlew'
      workingDirectory: '$(Build.SourcesDirectory)'
      tasks: 'build azureFunctionsPackageZip'
      publishJUnitResults: true
      testResultsFiles: "build/test-results/test/TEST-*.xml"
      testRunTitle: 'test'
      jdkVersionOption: 1.17
      javaHomeOption: 'JDKVersion'
      options: '-d -stacktrace'

It’s a pretty simple azure function, more or less straight out of the “box”:
// My function

import java.time.LocalDateTime;

import com.microsoft.azure.functions.ExecutionContext;
import com.microsoft.azure.functions.annotation.FunctionName;
import com.microsoft.azure.functions.annotation.TimerTrigger;

/**
 * Azure Functions with Timer trigger.
 */
public class UploadFilesTrigger {
    /**
     * This function will be invoked periodically according to the specified schedule.
     */
    @FunctionName("UploadFiles")
    public void run(
        @TimerTrigger(name = "timerInfo", schedule = "0 30 3 * * *") String timerInfo,
        final ExecutionContext context
    ) {
        context.getLogger().info("Java Timer trigger function executed at: " + LocalDateTime.now());
    }
}

When I build it local with Gradle 8.3, then it succeeds, but in Azure it fails.

But heres the kicker.

If I replace it with a HttpTrigger function, then the build works both local and in Azure DevOps.

Please advise, because I am going crazy here…

build.gradle

plugins {
    id "com.microsoft.azure.azurefunctions" version "1.15.0"
    id 'java'
}

group = 'xx.xxx.xxxx'
version = '1.0-SNAPSHOT'
sourceCompatibility = '17'

repositories {
    mavenCentral()
}

dependencies {
    implementation platform('com.azure:azure-sdk-bom:1.2.20')
    implementation 'com.microsoft.azure.functions:azure-functions-java-library:3.0.0'

    testImplementation platform('org.junit:junit-bom:5.9.1')
    testImplementation 'org.junit.jupiter:junit-jupiter'
}

azurefunctions {
    resourceGroup = 'java-functions-group'
    appName = 'acsepto-flat-files-integration-triggers'
    pricingTier = 'Consumption'
    region = 'westeu'
    runtime {
        os = 'linux'
    }
}

test {
    useJUnitPlatform()
}

LOG from azure

[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':azureFunctionsPackage'.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > generate configuration files and prepare staging directory
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --scan to get full insights.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Get more help at https://help.gradle.org.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':azureFunctionsPackage'.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:149)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:147)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:135)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
.........
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.composite.internal.DefaultBuildController$BuildOpRunnable.run(DefaultBuildController.java:198)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: org.gradle.api.GradleException: Cannot package functions due to error: Local Azure Functions Core Tools does not exist or is too old to support function extension installation, skip package phase. To install or update it, see: https://aka.ms/azfunc-install
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at com.microsoft.azure.plugin.functions.gradle.task.PackageTask.build(PackageTask.java:57)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	... 152 more
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: com.microsoft.azure.toolkit.lib.common.exception.AzureExecutionException: Local Azure Functions Core Tools does not exist or is too old to support function extension installation, skip package phase. To install or update it, see: https://aka.ms/azfunc-install
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at com.microsoft.azure.toolkit.lib.legacy.function.handlers.FunctionCoreToolsHandlerImpl.assureRequirementAddressed(FunctionCoreToolsHandlerImpl.java:59)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at com.microsoft.azure.toolkit.lib.legacy.function.handlers.FunctionCoreToolsHandlerImpl.installExtension(FunctionCoreToolsHandlerImpl.java:40)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at com.microsoft.azure.plugin.functions.gradle.handler.PackageHandler.installExtension(PackageHandler.java:312)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at com.microsoft.azure.plugin.functions.gradle.handler.PackageHandler.execute(PackageHandler.java:126)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	at com.microsoft.azure.plugin.functions.gradle.task.PackageTask.build(PackageTask.java:53)
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 	... 152 more
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
[ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 46s1

This does not so much sound like a Gradle issue, but like a problem with that Azure plugin, so you should maybe ask their support how to fix it.
Your error also contains a help URL, maybe that can already help you to resolve your issue?