I have a piece of code that needs to run an integration depending on whether the code is running in PROD environment. What is the best way of determining this? Microsoft changes DB Server name from time to time. I am thinking of using DB name since it seems to be stable. We don't want to check any field that is set manually since that is error prone. For eg. we can check if email parameter is set to blank or any particular value since we use different email for PROD and other environments but there is always a chance that someone might use PROD email for nonPROD environment.
Any suggestions?