Custom Web.config Transforms per env

We have a few environments, QA1, QA2, QA3, Staging, and Production and need to enable transforms. I know how that automatic transforms work,, however, I want to apply the Production values to the Staging environment without maintaining another transform value in our codebase. (Our Staging box is a canary server, that is 100% the same as PROD, but doesn’t take consumer traffic, and is used for testing prior to full rollout)

Is there a way to cleanly do this? I am tempted to create project variables, disable Automatically run config transform files, and then define my transforms to be Web.#{EnvName}.config => Web.config.

Or is there a better way to apply the same config to multiple envionments?

Hi Casey,

Thanks for getting in touch! The method that you have suggested is actually the best option for doing this in Octopus.
We don’t have any cleaner approach sorry, Your method of setting the variable EnvName to your environment and scoping them to their respective environments then calling Web.#{EnvName}.config is exactly how we would suggest it be done.

If you happen to run into any issues with this or have any more questions, please don’t hesitate to get in touch.