Getting the environment tag using Environment Variable - eaardal/konfiggy GitHub Wiki
This method resolves the environment tag using the machine's environment variables. You'll have to set this variable up manually on all servers the app will be running on, but it's just the one-time job and you can forget all about it forever after.
In your start-up logic, set Konfiggy's EnvironmentTagStrategy property to the EnvironmentVariableTagStrategy implementation.
IKonfiggy konfiggy = new Konfiggy();
konfiggy.EnvironmentTagStrategy = new EnvironmentVariableTagStrategy();
The KonfiggyIdentifier property on EnvironmentVariableTagStrategy is the name of the system environment variable Konfiggy will look for. By default this is "Konfiggy".
In order to set up a new Konfiggy environment variable go to Control Panel\System and Security\System\Advanced System Settings\Environment Variables (Also check out RapidEE for managing environment variables), add a new variable called "Konfiggy" and give it a value which should be a environment tag (such as "dev", "test" or "prod").
Konfiggy will look in both User Variables and System Variables (in that order) for a variable named Konfiggy (or whatever you named it and set in the KonfiggyIdentifier property) and use its value for the environment tag.