title: How to setup deployments in Azure so that they use different databases depending on the environment?
body: <p>You can easily swap two deployments between staging and production environment in the Azure Management Portal by swapping their VIP. When working on a staging version of the services we want to use a staging database as well so we don't risk clobbering actual customer data. However, after swapping staging and production services the now-production (and formerly staging) deployment should obviously work on the production database.</p>
  
  <p>So essentially the database to use would depend on whether the instance runs in the <em>Staging</em> or <em>Production</em> environment. Is there a good way of achieving that? Relying on the VIP and hard-coding the database switching based on that is probably not the best idea, I guess.</p>