You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm debugging a Bot Service instance, running locally in the functions cli. I downloaded the appsettings.json file from the online instance, which was neatly copied into appsettings.json locally. When I run "func settings", it shows the correct output. Here is the output with a very simple (test) appsettings.json:
E:\Sources\github\bots-test>func settings list
-> Name: AD_CLIENT_ID
Value: *****
But now when I run the function (debug) in VS, and I have this line:
var test = System.Configuration.ConfigurationManager.AppSettings["AD_CLIENT_ID"];
that gives null. This seems so trivial that I'm completely lost on what is happening here. I've used the app settings in other functions before in the exact same way, never had any issues. Also tried decrypting the file first, nothing. So what could I be overlooking?
The text was updated successfully, but these errors were encountered:
@jsiegmund As far as I'm aware, the contents of the "appsettings.json" file is not actually loaded into ConfigurationManager.AppSettings. This is somewhat counter-intuitive. I would use the environment variables API. See here for a quick example.
Confirmed that using the environment variables indeed fixes the issue. The weird thing though is that I've been using the other method for different functions where it seems to work just fine. So that's very counter intuitive indeed. I'll create a more concrete issue on the other side.
I'm debugging a Bot Service instance, running locally in the functions cli. I downloaded the appsettings.json file from the online instance, which was neatly copied into appsettings.json locally. When I run "func settings", it shows the correct output. Here is the output with a very simple (test) appsettings.json:
But now when I run the function (debug) in VS, and I have this line:
var test = System.Configuration.ConfigurationManager.AppSettings["AD_CLIENT_ID"];
that gives
null
. This seems so trivial that I'm completely lost on what is happening here. I've used the app settings in other functions before in the exact same way, never had any issues. Also tried decrypting the file first, nothing. So what could I be overlooking?The text was updated successfully, but these errors were encountered: