(1) we have a web application running on Azure Web Site using Sql Server (Web Edition). The application includes two connection strings:
DefaultConnection - normal connection string, in the form of
Server=tcp:{my-sql-server}.database.windows.net,1433;Database=...
).EFConnection - Entity framework connection string. Since im using the EF designer (and loving it) i need to use a connection string in the form of
metadata=res://*/Models.EDM...
(2) I've placed the connection strings in the web.config
; this is the only way the "metadata..." (EF) connection string was accepted (when tried to enter these connection strings in the Azure web site's control panel, i got all kind of strange errors).
Everything works great.
(3) Next, I have added a staging slot to our web site to perform staged development, as described in Staged Deployment on Microsoft Azure Web Sites
The staged site works fine. I've created for it a different Sql Server, and set its connection string in the same manner as in the production site (ie. in the web.config). I handle the different web.config
using web.config Transformations
. (i have another 2 transformations - for development/debug and for local deployments/release)
The problem: now that i have a production + staging site, i try to do swap. The swap works great, and any changes introduced to the staging site are swapped to the production.
However, the swap also takes the connection strings from the staging site, connecting the production to the staging database.
*Is this a known bug? is there a work-around? (for now i am required to do direct deployment to the production site once QA tested the staged site - this means downtime for our site, and quiet defeats the purpose of this whole exercise)