Where to set Value for Microsoft.Bot.Builder.Azure.Utils.GetAppSetting on local machine?

点点圈 提交于 2019-12-25 03:24:50

问题


I downloaded the sample code from azure's bot app, and there is a line which i'm not sure where is the config value should be store. i try not to change the code as later i need publish back into azure server. So for this line

var qnaKBId = Utils.GetAppSetting("QnAKnowledgebaseId");

Where should i create the variable for above when i need to code on my local machine?

I tried create the variable in web.config but it getting null. and the document not specify any detail.


回答1:


In documentation, we can find that Microsoft.Bot.Builder.Azure.Utils is a utility class for bots running on Azure.

I tried create the variable in web.config but it getting null.

If you’d like to run your bot application on local and access settings from your web.config file, you can use the following code snippet to retrieve it in your bot application.

var qnaKBId = ConfigurationManager.AppSettings["QnAKnowledgebaseId"];


来源:https://stackoverflow.com/questions/51015338/where-to-set-value-for-microsoft-bot-builder-azure-utils-getappsetting-on-local

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!