tsohtan
tsohtan

Reputation: 850

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

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.

Upvotes: 0

Views: 131

Answers (1)

Fei Han
Fei Han

Reputation: 27793

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"];

Upvotes: 2

Related Questions