Azure function times out - No response

Umamaheswara R Avula 20 Reputation points
2024-09-24T19:23:41.3866667+00:00

Running Azure function as a springboot application in local environment. Build and deployment is successfull, however when i hit the endpoint via postman...not getting response. Seeing below and then it just times out

Details below -

using - Java 1.8

<azure.functions.maven.plugin.version>1.28.0</azure.functions.maven.plugin.version>

<groupId>com.microsoft.azure</groupId>

<artifactId>azure-functions-maven-plugin</artifactId>

<version>1.22.0</version>

<dependency>

<groupId>org.springframework.cloud</groupId>

<artifactId>spring-cloud-function-adapter-azure</artifactId>

<version>4.0.4</version>

</dependency>

<property>

<name>FUNCTIONS_EXTENSION_VERSION</name>

<value>~4</value>

</property>

Executing HTTP request: {

[2024-09-24T19:15:08.591Z] "requestId": "8008b58f-744f-4499-a7b3-74436627851f",

[2024-09-24T19:15:08.593Z] "method": "GET",

[2024-09-24T19:15:08.596Z] "userAgent": "PostmanRuntime/7.42.0",

[2024-09-24T19:15:08.599Z] "uri": "/api/<<endpoint>>"

[2024-09-24T19:15:08.602Z] }

[2024-09-24T19:15:08.860Z] Request successfully matched the route with name 'healthCheck' and template 'api/healthCheck'

[2024-09-24T19:15:08.997Z] Executing 'Functions.' (Reason='This function was programmatically called via the host APIs.', Id=149bd77e-42e6-4a0b-95e5-da60e853c9c1)

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

2 answers

Sort by: Most helpful
  1. Umamaheswara R Avula 20 Reputation points
    2024-09-24T23:49:10.08+00:00

    Hi @LeelaRajeshSayana-MSFT - Thanks for your response. The issue i am facing is in my local. It is a simple function...below is the code snippet

    @FunctionName("healthCheck")
    public HttpResponseMessage healthCheck(@HttpTrigger(name = "req", methods = {
           HttpMethod.GET }, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage<Optional<String>> request,
           final ExecutionContext context) {
        System.out.println("The PAN Service is up and running");
    
    
    return request.createResponseBuilder(HttpStatus.OK).body("The PAN Service is up and running").build();
    
    
    
    

  2. LeelaRajeshSayana-MSFT 15,556 Reputation points Microsoft Employee
    2024-09-25T23:37:19.42+00:00

    Hi @Umamaheswara R Avula Thank you for sharing your code snippet. The function app signature seems correct. Can you put a break point at the function definition and see if it is getting hit when launched in debug mode?

    Would you also give a try by using the code sample provided in the GitHub repo outlined in the documentation Example "Hello, world" Spring Boot application that runs on Azure Functions and see if that helps.

    0 comments No comments

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.