Insert configuration variables if they don't exist

We’re wondering if it would be possible to have Octopus insert configuration variables as app settings if they don’t exist in the file rather than only replacing what’s already there. If that’s not in the cards, is there a workaround that would enable us to mimic this behavior?



Octopus can’t natively do this, but in PowerShell we do provide a dictionary called $OctopusParameters. In your Deploy.ps1 script, you could loop through all the key/value pairs in this dictionary and use it to insert lines in the configuration file. (You may want to ignore keys that start with “Octopus.”)

Hope that helps,