I have so far used the appsettings.{environment}.json
files to keep application level configuration settings. Now I encounter this tab in Azure Portal for an App Service.
What is the difference between using the appsettings.json
files and "Application Settings" Tab in the Azure Portal? And which one to use When?
2
Answers
If you are using more than one environment like Production, Staging and Development for your application. You need specific Environment appsettings i.e.,
appsettings.{environment}.json
.Or if you don’t want to use any specific environment. In this case you are using only production (Default) Environment you can use
appsettings.json
file.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 createappsettings.json
by reading those values.2nd – This time we are committing
appsettings.json
and deployed web app on Azure. We also have a property asNow, 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
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
.