I'm using Octopus Deploy to deploy ASP.NET 5 websites to Azure based on this guide: https://gist.github.com/alfhenrik/ee08dbb1fb6e2bc7f772
I'm trying to find a way to transform configuration files but haven't found any elegant solutions yet. Currently my best suggestion is to have an appsettings.json with config used in the local dev environment and an appsettings.Release.json which is an exact copy of appsettings.json where all values are octopus variables like #{myVariableName}. Then when deploying with Octopus we have a pre-deployment script that replaces appsettings.json with appsettings.Release.json and then run variable substitutions on appsettings.json.
Any better suggestions?
What I did to solve this, was to use xml configuration instead of json. I moved all my config from my appsettings.json and appsettings.Release.json to Web.config and Web.Release.config and added .AddXmlFile("Web.config") in Startup.cs. This way, I can use the built in configuration transformation in Octopus Deploy while waiting for them to start supporting ASP.NET 5 apps properly.
UPDATE 2016-02-02: Support for .json configuration files has now been added to Octopus Deploy as of v3.3. See https://octopus.com/blog/octopus-deploy-3.3#ASPNETCoreJSON