Azure function code is not invoked

Anatolii Zenkovych (CW) 0 Reputation points
2025-04-26T16:30:40.6066667+00:00

Hello

I have a functional app with 3 java functions

  • Github listener (@HttpTrigger): posts received payload into EventGrid and Kafka listeners
  • EventGrid listener (@EventGridTrigger)
  • Kafka listener (@KafkaTrigger)
{
  "scriptFile" : "../plat-jdp-umm-notification-service-1.0.0.jar",
  "entryPoint" : "com.jda.jdp.umm.event.listener.GitHubEventListener.run",
  "bindings" : [ {
    "type" : "httpTrigger",
    "direction" : "in",
    "name" : "req",
    "methods" : [ "POST" ],
    "authLevel" : "FUNCTION"
  }, {
    "type" : "eventGrid",
    "direction" : "out",
    "name" : "outputEvent",
    "topicKeySetting" : "GITHUB_TO_UMM_TOPIC_KEY",
    "topicEndpointUri" : "GITHUB_TO_UMM_TOPIC_ENDPOINT_URI"
  }, {
    "type" : "kafka",
    "direction" : "out",
    "name" : "kafkaOutputEvent",
    "protocol" : "SASLSSL",
    "password" : "%CONFLUENT_KAFKA_PASSWORD%",
    "topic" : "%CONFLUENT_KAFKA_TOPIC_NAME%",
    "authenticationMode" : "PLAIN",
    "username" : "%CONFLUENT_KAFKA_USERNAME%",
    "brokerList" : "%CONFLUENT_KAFKA_BROKER_LIST%"
  }, {
    "type" : "http",
    "direction" : "out",
    "name" : "$return"
  } ]
}


HttpTrigger function registers invocations, but does not invoke the function's code and eventually fails in 30 minutes, that can be seen in the logs.

Screenshot 2025-04-26 at 19.07.21

Similar behavior is observed for event listeners - they are never triggered and fail every 30 minutes.

Screenshot 2025-04-26 at 19.22.08

Since all 3 functions have similar issue pattern, that make me believe there is a common reason, likely configuration issue.

Hope the info I provided is enough. Do you have any idea why this is happening?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,723 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 19,616 Reputation points
    2025-04-26T23:54:11.32+00:00

    Hello Anatolii Zenkovych (CW),

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that your Azure function code is not invoked.

    Since all 3 functions and (configuration, Always On, network/firewall, diagnostics) are failing without executing — they are just stuck for 30 minutes and time out — indicating misconfiguration at a more fundamental level. I will suggest the following to resolve the issues:

    • If @FunctionName is missing or wrong Azure won't load your function. Ensure Java classes have @FunctionName with correct signatures. So that each of your 3 Java methods must have a correct structure. For an example:
        package com.jda.jdp.umm.event.listener;
        import com.microsoft.azure.functions.annotation.*;
        import com.microsoft.azure.functions.*;
        public class GitHubEventListener {
            
            @FunctionName("GitHubHttpListener")
            public HttpResponseMessage run(
                @HttpTrigger(name = "req", methods = {HttpMethod.POST}, authLevel = AuthorizationLevel.FUNCTION)
                HttpRequestMessage<Optional<String>> request,
                final ExecutionContext context) {
                context.getLogger().info("GitHub event received.");
                return request.createResponseBuilder(HttpStatus.OK).body("OK").build();
            }
        }
      
    • Your function.json file must match exactly what the Java annotations define. For example, for HTTP trigger:
        {
          "bindings": [
            {
              "authLevel": "function",
              "type": "httpTrigger",
              "direction": "in",
              "name": "req",
              "methods": [ "post" ]
            },
            {
              "type": "http",
              "direction": "out",
              "name": "$return"
            }
          ]
        }
        
      
      Mismatch between function.json and Java annotations is = no function invocation.
    • Check your host.json and AppSettings for Java runtime settings - https://learn.microsoft.com/en-us/azure/azure-functions/functions-develop-java
    • Check Application Insights/Kudu Logs for binding load errors - https://learn.microsoft.com/en-us/azure/azure-functions/functions-monitoring?tabs=applicationinsights#view-logs-in-kudu
    • Also, in sometimes EventGrid and Kafka triggers require you to enable Extension Bundles in host.json:
        "extensionBundle": {
            "id": "Microsoft.Azure.Functions.ExtensionBundle",
            "version": "[2.*, 3.0.0)"
        }
        
      
      Without it, EventGrid/Kafka might not bind correctly at runtime.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.