I created an environment variable to store a value that is different in my staging environment versus my production environment. In the staging environment, I set the "default value" of the variable to the value that should be used in prod, and the "current value" to the value that should be used in staging.
My understanding is that the "current value" needs to be removed from the solution before exporting my solution and importing to production, since otherwise the staging value will be promoted and used in production.
I have tried both "remove from this solution" and "delete from this environment," but both options have resulted in the environment variable not being promoted to production at all.
Do you set a "Default value" for the Environment Variable for using within Production Environment?
Actually, it is not necessary to remove the "current value" for your Environment variable before exporting and importing to another Environment through solution.
Currently, the "current value" of Environment variable could not remain the same across different environments. When you import the Environment variable from your staging Env to Prod Env, the "current value" of the Environment variable would be lost.
Only the "Default value" of the Environment variable could remain the same across different environments. Please check the following blog for more details:
On your side, you just need to set a "Default value" for your Environment variable, then export the solution contains the Enviroment variable from your staging Env, then import it into your Prod Env, after that, you could use the "Default value" of the Environment variable in your Prod Env (through the Environment Variable Definition and Environment Variable Value entities).
Community Support Team _ Kris Dai If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ah, I see. So the options "remove from solution" and "delete from this environment" remove the entire variable (including the default value)? I did have a default option set, but the variable did not promote at all.