gpt4 book ai didi

azure - Azure WebJobs SDK 基础知识

转载 作者:行者123 更新时间:2023-12-05 00:13:08 25 4
gpt4 key购买 nike

我想了解 Azure WebJobs SDK 上的 JobHostConfiguration。我在哪里可以找到配置?它在 app.config 上吗?

JobHostConfiguration 如何识别这是不是 IsDevelopment ?我在 app.config 上找不到它

JobHostConfiguration 读取什么配置?

谢谢

最佳答案

Where I can find the config ? is it on app.config ?

是的,它位于 app.config 文件中。您还可以在此文件中手动添加一些新配置。

How can JobHostConfiguration identified this is IsDevelopment or not ?

这取决于JobHost是否在开发环境中运行。默认值为 false。如果你希望它是真的,你可以在app.config文件中添加以下代码,让JobHost运行在开发环境。你可以阅读这个 article了解有关此配置的更多信息。

<appSettings>
<add key="AzureWebJobsEnv" value="Development"/>
</appSettings>

结果是这样的:

enter image description here

What config that JobHostConfiguration read ?

它可以读取许多配置信息,例如Azure Web Jobs的连接字符串。您可以单击“新建项目”>“云”>选择“Azure WebJob”来创建一个 Web 作业来尝试。

读取app.config文件中的连接字符串:

<connectionStrings>
<!-- The format of the connection string is "DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY" -->
<!-- For local execution, the value can be set either in this config file or through environment variables -->
<add name="AzureWebJobsDashboard" connectionString="your storage connection string" />
<add name="AzureWebJobsStorage" connectionString=" your storage connection string " />
</connectionStrings>

enter image description here

关于azure - Azure WebJobs SDK 基础知识,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49022216/

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