Sitecore 9 : Custom Config Roles
I recently wrote a detailed post about all the config changes in Sitecore 9. I highly recommend taking a read if you have not done so already.
I suggested in that post that we could introduce custom configuration roles in order to allow us to configure specific settings for different environments, such as UAT or Pre-Prod for example. After a conversation with Alen Pelin he told me of a much better way to achieve this, which is both cleaner and semantically more correct.
I assumed there was something hardcoded in code to worked against specific AppSettings keys during the patching process. Turns out there is way more magic happening here than that – we can define whatever keys we want and follow a convention to have those applied. Looking at it again and with this additional info, it turns out this is exactly the same as how the configuration works to switch search providers.