Azure Function Supports JDK 11?

Anonymous
2020-11-11T10:14:11.577+00:00

Hi , I am trying to work on below example , by changing it to JDK 11.

https://learn.microsoft.com/en-us/azure/azure-functions/functions-event-hub-cosmos-db

But i keep getting below warning

[WARNING] Azure Functions only support JDK 8, which is lower than local JDK version 11.0.8.).
Also i am getting below issue while deploying

Also while deploying i am getting below error.39112-functionapp-jav11.png

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

Answer accepted by question author
  1. JayaC-MSFT 5,606 Reputation points
    2020-11-17T10:06:47.417+00:00

    @Anonymous To get the connection string , go to the azure portal, navigate to the cosmos db resource, go to keys and copy the primary string as shown below:

    40297-image.png

    Then you can put the value in local.settings.json as key value pair: "settingsName" : "settingsValue."

    Please refer to functions-run-local

    functions-bindings-cosmosdb-v2-output - For cosmosDB output binding.

    Let me know if this helps.


1 additional answer

Sort by: Most helpful
  1. Anonymous
    2020-11-13T05:33:10.827+00:00

    Hi i am able to work for JDK 11 by making below changes :
    <property>
    <name>FUNCTIONS_EXTENSION_VERSION</name>
    <value>~3</value>
    </property>

    and

    <runtime>
    <!-- runtime os, could be windows, linux or docker-->
    <os>windows</os>
    <javaVersion>11</javaVersion>

    But when i am giving in host.json version as 3 it is failing with below error
    {
    "version": "3.0",
    "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[1.*, 3.0.0)"
    }
    }
    But as per the articles we should make keep it 3.x


Your answer

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