I have gone through a couple of similar questions in SO but both are not working as expected in the Azure environment.
I have the following appsettings.json
configuration
{
"Luis": {
"SubDomain": {
"AreaOne": {
"AppIds": {
"Us": "12345678",
"India": "567890"
},
"APIKey": "xyz123",
"HostName": "www.example.com"
},
"AreaTwo": {
"AppIds": {
"Us": "12345679",
"India": "887890"
},
"APIKey": "xyz456",
"HostName": "www.exampleareatwo.com"
}
}
}
}
We are trying to bind it to the following object
public class Luis
{
public Dictionary<string,SubDomain> SubDomainLuis { get; set; }
}
public class SubDomain
{
public Dictionary<string, string> AppIds { get; set; }
public string APIKey { get; set; }
public string HostName { get; set; }
}
We are getting the proper result in the local environment but after hosting the azure app service it shows as null
value.
This is the constructor code:
The LuisConfig.SubDomainLuis
is always returning a null value in the azure environment.
var LuisConfig = new Luis();
ConfigurationBinder.Bind(configuration.GetSection(nameof(Luis)), LuisConfig);
Startup class:
var config = new Luis();
Configuration.Bind("Luis", config);
services.AddSingleton(config);
The directory is always copying the settings file.
These are the questions I have already referred.