3

I recently swapped a staging Azure app into production with the "Swap with preview" function, and after completing the swap, the production app was pointing to the staging SQL DB connection string. In the app settings, I have the staging connection string saved and checked as a slot setting in the staging slot, and the production connection string saved and checked as a slot setting in the production slot.

Has anyone encountered this? I need the respective connection strings sticky to their respective slots, but in my case, the swap carried the source string to the target production slot, even though I THINK I configured the strings properly as slot settings and checked them in both environments.

juvchan
  • 5,555
  • 2
  • 20
  • 32
Ben
  • 327
  • 1
  • 4
  • 17
  • How do you understand it isn't changed ?. Azure doesn't override psyhical file. So If you check psyhical file you will see published one(first one), but it overrides it anyway. – Erkan Demirel Apr 07 '16 at 15:11
  • I am verifying this by watching the database tables after deployment. After the swap, the staging tables are being written to by our production users. This shouldn't be happening if I made the connection strings sticky to each slot - the staging connection string should be sticky to the staging slot and the prod connection string to the prod slot. – Ben Apr 07 '16 at 15:35
  • 1
    @Ben did you figure this out? I am having a similar problem and now my sites won't work when I switched the DB to the one intended. Thinking about just deleting the slots/DB's and starting over, but that is not a really good solution. :( – REMESQ May 05 '16 at 21:27
  • I think I am going to do the same. I'm working with someone with Microsoft Azure right now and he is basically suggesting the same thing. It appears my slot settings are not really serving any purpose, in that they are not being read at all when I perform a swap. I confirmed this via some remote debugging and I even changed the connection string in the slots to a non-existent DB and I was still able to make connections. Also, I can see the web.configs in each slot after the swapping and they indeed have the connection strings backwards. – Ben May 06 '16 at 16:05
  • EDIT: there's something wonky going on with my connection strings at runtime. When I deploy to a slot, the DB connection string being used to connect to a SQL database for some reason is the one generated in the web.config for the entity framework, not the actual SQL connection string. Since the EF string has the SQL string embedded in it, it's able to use that string to connect. – Ben May 12 '16 at 15:09

1 Answers1

0

In AppSettings on the Azure Portal click the "Slot Setting" option next to your connection string: enter image description here

viperguynaz
  • 11,592
  • 4
  • 27
  • 41