Azure-Samples / hello-spring-function-azure

Example "Hello, world" Spring Boot application that runs on Azure Functions
MIT License
68 stars 87 forks source link

HttpTrigger requests bypass handler and invoke function directly #34

Closed sbsatter closed 3 years ago

sbsatter commented 3 years ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report 
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

git clone https://github.com/Azure-Samples/hello-spring-function-azure run DemoApplication in IntelliJ 2021.2.2 Ultimate Log messages in handler method does not appear in console

Any log messages given by the failure


>   .   ____          _            __ _ _
>  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
> ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
>  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
>   '  |____| .__|_| |_|_| |_\__, | / / / /
>  =========|_|==============|___/=/_/_/_/
>  :: Spring Boot ::                (v2.5.4)
> 
> 2021-10-08 12:44:25.670  INFO 61943 --- [           main] com.example.DemoApplication              : Starting DemoApplication using Java 11.0.10 on Shaheds-MBP with PID 61943 (/Users/sbsatter/Development/IntelliJ/hello-spring-function-azure/target/classes started by sbsatter in /Users/sbsatter/Development/IntelliJ/hello-spring-function-azure)
> 2021-10-08 12:44:25.679  INFO 61943 --- [           main] com.example.DemoApplication              : No active profile set, falling back to default profiles: default
> 2021-10-08 12:44:26.317  INFO 61943 --- [           main] o.s.c.f.web.flux.FunctionHandlerMapping  : FunctionCatalog: org.springframework.cloud.function.context.catalog.BeanFactoryAwareFunctionRegistry@103082dd
> 2021-10-08 12:44:26.474  INFO 61943 --- [           main] o.s.b.web.embedded.netty.NettyWebServer  : Netty started on port 8080
> 2021-10-08 12:44:26.485  INFO 61943 --- [           main] com.example.DemoApplication              : Started DemoApplication in 1.126 seconds (JVM running for 2.174)
> 
> Process finished with exit code 130 (interrupted by signal 2: SIGINT)
> 

Expected/desired behavior

Handler should be invoked before handleRequest(...) is invoked.

OS and Version?

MacOS 11.5.2

Versions

    azure.functions.java.library.version = 1.4.2
    azure.functions.maven.plugin.version = 1.13.0

Mention any other details that might be useful


jdubois commented 3 years ago

Did you run your application like in the documentation, using ./mvnw azure-functions:run?

sbsatter commented 3 years ago

With mvn it seems to run fine. Is it not supposed to work with IntelliJ 'run application'?

jdubois commented 3 years ago

The plugin does more than just run the Java executable, you need to have the Function runtime available too. You can probably achieve the same with Intellij, but the documentation is for everyone, including Eclipse/Netbeans/VSCode, that's why we rely on the plugin. I'm closing this as the documentation is correct.