Octopus Variables vs Web.Config transformations

Hi,

I prefer to have one transformation Web.Config per environment, so I don’t have to create redundant variables in Octopus, but other people prefer to put the env specific variable in Octopus.

When we should use one or another?

Thanks,
Miguel

Hi Miguel,

Thanks for reaching out!

I guess it totally depends on what makes you feel more comfortable. I personally like to have a single web.config file , and the redundant variables in Octopus because I believe the config file should be a dumb skeleton full of blank spaces that should be filled up during the deployment. That way if I screw up in a config file value, most of the times I only have to change a variable in Octopus and run another deployment, instead of changing the web.config in source control -> re-buiilding and packaging my app -> creating another release -> etc.

I guess It ultimately depends on if you feel more comfortable making the changes in your source control (multiple web.config files) or in your deployment automation tool (redundant variables).

Perhaps the fact that I’m part of the Octopus team kinda explains why I feel more comfortable making the changes on the Octopus side :wink:

Cheers,
Dalmiro

Hi,

IMHO in web.config:

It's easier to bring new developers to the team, as they don't have to know Octopus; 

It's easier to understand and read, since in Octopus we have a bunch of variables that we don't know to which environment they belong and we have no notion of what's being transformed just looking at them, which we know using transformation web.config's;

We become more Octopus agnostic. Sure we can never be 100% agnostic of the tools we use, but best practices and experience tell us, that we should be as more agnostic from the tools and frameworks we use as we can, because in the future my company might decide to migrate to another tool other than Octopus.

Thanks,
Miguel

Hi Miguel,

That’s an absolutely valid point for using transformations. Like I said, in the end It’ll always depeden on what makes you feel more comfortable.

Regards,
Dalmiro