2

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?

enter image description here

blogs4t
  • 2,329
  • 5
  • 20
  • 33
  • Does this answer your question? [Azure Application Settings not overriding my appsettings.json file values](https://stackoverflow.com/questions/45298562/azure-application-settings-not-overriding-my-appsettings-json-file-values) – ryanwebjackson Jul 30 '22 at 17:20
  • 1
    @ryanwebjackson I believe it falls in line however, i will keep this question open to see if i get any other responses. Thanks! – blogs4t Jul 30 '22 at 17:47

2 Answers2

0

difference between using the appsettings.json files and "Application Settings" Tab in the Azure Portal? And which one to use When?

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.

Delliganesh Sevanesan
  • 4,146
  • 1
  • 5
  • 15
0

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.

Vikram Singh Saini
  • 1,749
  • 3
  • 22
  • 42