I do not believe that something will change when it comes to the role when you do a VIP exchange. Rather, it changes the load balancing configuration.
Nothing happens in your application to force it to change the configuration. The only thing I can think of is that the URL changes between them. You could implement the code that selected one of the two connection strings based on the URL it was addressed to (assuming we are only talking about a web role), but it seems messy.
In essence, I think the problem is that staging is not a separate test environment; This is a step in production. Therefore, Microsoft's assumption is that the configuration does not change.
source share