如何在 ADF 中为 Azure Function 设置 JAVA_HOME 环境

问题描述 投票:0回答:1

我正在用 Python 编写一个连接到 IBM informix 数据库的 Azure 函数。我使用

jaydebeapi
作为连接库,并使用 JDBC 进行连接。 但是,当我运行连接代码时

conn = jaydebeapi.connect(...)

我得到的错误是

 No JVM shared library file (libjvm.so) found. Try setting up the JAVA_HOME environment variable properly.

我怀疑我需要为该函数设置 JAVA_HOME 变量,但我不知道如何为 ADF 中的 Azure 函数执行此操作,也不知道该目录应指向何处。我该怎么办?

请不要回复有关 Informix 的 ADF 链接服务的答案,我知道这一点,我不想要它,出于某种原因,我需要通过 Azure Functions 来执行此操作。

我还没有尝试过任何东西,因为我不知道如何开始这个过程。在线搜索没有结果,因为这是一个非常独特的情况(我认为)。

azure azure-functions azure-data-factory
1个回答
0
投票

为了在连接到 ADF 的函数中安装 JVM,您需要通过 Advance tools kudu 通过 SSH 进入函数应用程序,然后运行以下命令:-

apt-get  update
apt-get install default-jdk
java -version
which java

enter image description here

输出:-

enter image description here

enter image description here

enter image description here

现在将此路径添加到功能应用程序设置中,如下所示:-

JAVA_HOME


enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.