It seems like someone would have asked this before, but I can’t find it in the list of questions, and I can’t think of any intuitive way to do it with the available options (unless because of the rules of variable precedence this just works. ). In which case, this question can maybe point back to those. I realize some of this may be reduced with multi-tenant changes, but I still expect this to present itself.
So let me ask my question and then suggest a couple of scenarios where I seem to get bitten on this.
Is there a way to set a default value for variables for all roles/environments unless specifically stated otherwise?
Example: We have variable substitution set up for logging. In dev, we went more debugging turned on by default, however because it isn’t an app setting, we have it set in the web.config to be a substitution variable. Then in our variables we have
key: logFilter, value: Error, Scope: Production (US), Production (EU), Disaster Recovery, Staging (US)… etc.
key: logFilter, value: Debug, Scope: Dev
So dev is the only place where I want the different value. Everywhere else, including (by default) onboarded environments should have “Error”. The onboarding is the thing that is dangerous right now because it is very easy to miss adding the scope to every variable (ignoring the fact that it’s a pain to go through all the different projects.)
Then there have been occasions where we’ve had a value set to something (say port 443 for where the site exists). I have it as a value, but now because some environment wants it set to 444 I not only have to add scope to the new value, but I have to go back and make sure not to miss any scope on the previously existing variable.