I have asp.net core application that has complex configuration setting, i am trying to create that setting on azure web app but it says invalid json. I know azure web app configuration support key pair value but i am not sure how to write this settings.
Please check below setting
"TenantSettings": {
"Identity": {
"ConnectionString": "Data Source=localhost;Initial Catalog=Identitydb;Integrated Security=True"
},
"Tenants": [
{
"TenantId": "demo1",
"ConnectionString": "Data Source=localhost;Initial Catalog=shareddb;Integrated Security=True"
},
{
"TenantId": "demo2",
"ConnectionString": "Data Source=localhost;Initial Catalog=shareddb1;Integrated Security=True"
}
]
}
My class look like this to load setting(class Name:TenantSettings), this works fine on local.
public class TenantSettings
{
public Configuration Identity { get; set; }
public List<Tenant> Tenants { get; set; }
}
public class Tenant
{
public string TenantId { get; set; }
public string ConnectionString { get; set; }
}
public class Configuration
{
public string ConnectionString { get; set; }
}

I found solution for this to add list of configuration we have to use :0 and :1 so on ex: TenantSettings:Tenants:0:ConnectionString, check below setting deployed on azure web app configuration setting.
Hope this will help someone.