0

I'm trying to add dependency injection to an Azure Web Function using Java. There are a good deal of examples to do so in C#. There is also a spring boot project that has got it to work. As far I can tell I should be able to add a bootstrap class with a main method to the local.settings.json file. Mine looks like this.

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "",
    "FUNCTIONS_WORKER_RUNTIME": "java",
    "MAIN_CLASS":"com.example.Startup"
  }
}

That class has a main method but it fails to run when I run the azure functions local runner (mvn azure-functions:run). I want to ensure any time the app is run that the class loads and runs before invoking the web endpoint.

1 Answer 1

1

The dependency injection support for Java doesn't exist.

There is an open ticket for this: https://github.com/Azure/azure-functions-java-worker/issues/324

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.