5

Can you please tell me how does the configuration file work in Azure functions? Visual Studio creates a local.settings.json file when creating an Azure function project but I guess that's local and cannot be deployed on Azure. Should I create an App.config file and probably use CloudConfigurationManager to access the setting variables?

Jayendran
  • 9,638
  • 8
  • 60
  • 103
blue piranha
  • 3,706
  • 13
  • 57
  • 98

1 Answers1

6

You are correct, when developing locally, the configuration values are read from local.settings.json.

However, when your function is running in Azure, the configuration values are read from App Settings.

So simply add an app setting and you can access it the same way you would access it if the function was running locally.

Andy T
  • 10,223
  • 5
  • 53
  • 95
  • 2
    This post will give you a little more depth into what local.settings.json is all about. https://stackoverflow.com/questions/57360238/using-configurationbuilder-in-functionsstartup/64901557#64901557 – Terence Golla Nov 19 '20 at 17:54