I am seeking a convenient method for deploying application settings for an Azure function that is deployed using Octopus deploy (or any automated deployment tool).
From Microsoft's guidance it seems that an azure function should not use a configuration file that would traditionally be transformed at deployment time to set environment-specific application configuration.. It is recommended to use a local.settings.json when using the azure tools to test the function on a local machine, but no file is used when deployed to an azure function app.
The alternative provided by Microsoft for azure functions is a set of environment variables that are configured through the portal interface. This setup works fine when you are manually setting everything up through the portal interface, but when deploying from an automated release management tool like Octopus deploy this becomes a real pain.
There are several methods that I have come across so far:
- Deploy the settings using an ARM template that can be transformed at deployment time.
- Post settings to Kudu REST API after deployment
- Use various powershell commands to replace app settings
Each of these methods will replace all application settings as there is no way to add/remove, without writing some custom code to get all settings, compare and update. This is very troublesome as there are some application settings that are not specific to my application and are required by the function host.
I could possibly add my own configuration file to by transformed and deployed with the function, which would certainly be easier than any other method I have come across, but feels like going against the grain of how functions were intended to be produced.
Does anyone have a clean and easy method of deploying application settings to an azure function app?