python - 从用于 python 的 Azure 函数获取应用程序设置值(环境)

标签 python python-3.x azure-functions azure-functions-runtime

我正在尝试从 python 的 azure 函数获取应用程序设置值。

我使用以下代码获取 Data_AzureConnection 值。

logging.info("OS Env")
logging.info("Env value")
test = os.environ["Data_AzureConnection"]
logging.info(test)

但是我得到了以下结果

enter image description here

为什么我看不到 Data_AzureConnection 值?

有什么方法可以从 azure 函数获取 python 应用程序设置的值吗? 如果有解决方案,请告诉我。

最佳答案

它只在日志中显示Hidden Credential,实际上您可以使用os.environ["Data_AzureConnection"] 在代码中获取它。它返回响应中的值,请参阅下面的测试结果。

enter image description here

关于python - 从用于 python 的 Azure 函数获取应用程序设置值(环境),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61485988/

相关文章:

python - 获取 ArrayField Postgres Django 的 len

python - 如何在抓取之前从数据库获取 url 和行 id 以在管道中使用它来存储数据?

python - 运行 openmdao 1.7.0 GUI

python-3.x - 在Python中转换黑白图像中1和0的列表列表

python - 如何在python中读取sql server View ?

java - 如何在 Java Azure 函数中使用事件中心触发器

python - 来自 pandas 数据框的输入的 sklearn classification_report 产生 : "TypeError: not all arguments converted during string formatting"

python - 当除数为零时保留旧值

python - 在 Django 迁移创建期间忽略 CharField "choices"中的更改

azure-functions - 当 azure 函数输入绑定(bind)到 azure 事件中心时,EventData 数组的大小