I’m trying to setup Staging and Live environments in Azure (September toolkit) and I want a separate Staging and Live database – with different connection strings. Obviously I can do this with web.config transformations back in Visual Studio, but is there a way I can automate a change of connection string during a VIP-swap – so that the staging site points to staging data and the live site to live data? I’d prefer not to have to deploy twice.
I’m trying to setup Staging and Live environments in Azure (September toolkit) and I
Share
I don’t believe anything changes as far as the role is concerned when you do a VIP swap. Rather, it alters the load balancer configuration.
So nothing happens in your app to cause it to change configuration. The only thing I can think of is that the URL changes between the two. You could implement code that chose one of two connection strings, based on the URL with which it was accessed (assuming that we’re only talking about a web role), but it seems messy.
Fundamentally, I think the issue is that staging isn’t a separate test environment; it’s a stepping stone into production. Thus, Microsoft’s assumption is that the configuration doesn’t change.