gpt4 book ai didi

azure - 如何获取 Azure 函数的 Host.json 文件中的全局设置

转载 作者:行者123 更新时间:2023-12-03 02:50:14 27 4
gpt4 key购买 nike

我在 host.json 文件中有一些设置。我知道这是功能应用程序的全局设置。我可以在本地但在生产环境中获取它。

在本地,我有这项工作
var maxDequeueCount=config.GetSection("扩展:队列:maxDequeueCount").Value;

有人告诉我如何从 host.json 文件中读取设置吗?

谢谢

var maxDequeueCount=config.GetSection("扩展:队列:maxDequeueCount").Value;

最佳答案

这对我有用:

var config = builder.GetContext().Configuration;
string maxAutoRenewDuration = config.GetSection("AzureFunctionsJobHost:extensions:serviceBus:messageHandlerOptions:maxAutoRenewDuration").Value;

关于azure - 如何获取 Azure 函数的 Host.json 文件中的全局设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56487309/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com