简体   繁体   English

如何在azure函数python中设置环境变量

[英]how to set environment variable in azure function python

I am trying to install jdk in python azure function with我正在尝试在 python azure 函数中安装 jdk

pip install install-jdk pip install install-jdk

import jdk导入jdk

path_to_java_home = jdk.install('15', jre=true) path_to_java_home = jdk.install('15', jre=true)

now I am trying to set the path for JAVA_HOME现在我正在尝试设置 JAVA_HOME 的路径

how can I do it?我该怎么做?

Setting a environment variable in an azure function is done by:在 azure 函数中设置环境变量是通过以下方式完成的:

  1. Navigating to your azure function in the azure portal在 azure 门户中导航到您的 azure 函数
  2. Under settings go to "configuration"在设置下转到“配置”
  3. Click the "+ new application setting" to add the variable点击“+新应用设置”添加变量
  4. Enter the name and value and then save输入名称和值,然后保存
  5. The variable can now be used as an environment variable in the code该变量现在可以用作代码中的环境变量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM