Few reasons to use Azure Application Settings -
1st - Let's assume that in order to avoid leaking configurations in appsettings.json
, you aren't committing it to your repo. But you also deploy your web app on Azure AppServices. In this situation Application Settings tab can help you to configure your configurations directly and then Azure will auto create appsettings.json
by reading those values.
2nd - This time we are committing appsettings.json
and deployed web app on Azure. We also have a property as
{
"Users": {
"CanAccessApp": [ "abc@gmail.com", "test@gmail.com" ],
"CanAccessHangfire": [ "abc@gmail.com", "test@gmail.com" ],
"CanAccessLog": [ "abc@gmail.com", "test@gmail.com" ]
}
}
Now, I also want one more user to be able to access logs. How you will do it? Generally, update in your appsettings.json
and redeploy.
Or you can create similar property in Application Settings by
Users:CanAccessLog:0 -> vic@gmail.com
Users:CanAccessLog:1 -> abc@gmail.com
Users:CanAccessLog:2 -> test@gmail.com
and so on where 0,1,2 are indexes of the array (Azure style). This one will help us to test quickly without redeploying or modifying appsettings.json
.