Azure Functions v2 - New .netcore Configuration and deployment Azure Functions v2 - New .netcore Configuration and deployment azure azure

Azure Functions v2 - New .netcore Configuration and deployment


This is not officially supported as of Nov 2019.

Warning

Avoid attempting to read values from files like local.settings.json or appsettings.{environment}.json on the Consumption plan. Values read from these files related to trigger connections aren't available as the app scales because the hosting infrastructure has no access to the configuration information.

There are so many blogs around advising to do this and it appears this may work if you only have a single instance, but as soon as the ScaleController triggers scaling, new instances will not be able to find the config files.

If you have triggers that use the %SettingName% syntax, they will not work as the function scales.

Functions team is considering possible Options (lol)

There is also the option of using the new App Configuration service but it is currently in preview and isn't available in all Azure regions.

It may be simpler to put your config in blob storage, and load it at startup? (Your blob store connectionstring will need to be in env variables)

So far the best we can do is to include your "not so secret" settings (things like MyThingTimeout or ExternalEndpointAddress) in a json file and use .AddJsonFile(...) and put secrets in KeyVault. This does force you to split your config and decide which goes where. (And also make sure your triggers only read from the Values section/Environment Variables)