0

I have a multi project configuration with gradle, where I have 3 projects

Application: here is located every config app file like MainApplication.class (who has the @SpringBootApplication annotation), the functions app files (host.json and local.settings.json) and other config files.

Domain: here is located my model and usecases following a clean architecture approach

Infrastructure: here is located the FunctionHandler class (who has the @Function annotation) and the Function class (this implements Function<T, R> interface)

The following image shows this relation

enter image description here

When I run ./gradlew azureFunctionsRun task, It seems like the functions started up

enter image description here

But when I try to invoke this function (it's a http trigger based) I'm getting this error

enter image description here

The MainApplication.class exists in the Application project and it respect the package name structure.

Anybody knows what could I try ? I want to have one project for all config and anothe project with all the functions

Here is a sample project: https://github.com/carvarr/spring-functions

1 Answers1

0

Just pushed a fix against your repo. The issue is that Azure Functions has its own (non-Boot) execution runtime that imposes its own packaging format (generated by the Azure's maven/gradle plugins). Therefore we can't use the (standard) Spring Boot's uberjar packaging, as it gets on the way of the Azure's packaging and leads to the missing classes.

You have to either disable the spring-boot plugin (as done in the fix) or opt for the spring-boot-thin-launcher instead. For the later you can check the maven samples here.

I've updated the Azure Adapter docs to clarify this requirement.

tzolov
  • 469
  • 4
  • 6