SQL Azure Connection String Settings for Visual Studio Projects Deployed to Azure Web Sites
I recently spent HOURS looking for a silly little SQL Azure connection string in my Visual Studio project. When I created the project I configured it to be deployed to an Azure web site and I also connected it with a SQL Azure server where I'm storing the data. Unfortunately I had entered an old password when I created the project, and from that point every time after I deployed to Azure web sites my project bombed with malice whenever I attempted to do anything that touched the database.
I actually tried to fix it myself in a variety of ways before stumbling across it's secret shelter. I changed the settings in the Package/Publish SQL part of the project properties; no joy. I tried adding the password to the project-dev.json settings file; no joy. I added web.config transforms for both debug and release; no joy. I even published the app to my desktop so I could make sure the web.config was getting transformed correctly. It was, the right connection string was in there, but it was not being used. Grr!
Finally a particularly brilliant friend of mine, David C., pointed me in the right direction. When you need to change that password, here's what you have to do:
1. Open up the Server Explorer in Visual Studio. Expand the Azure subscription (or connect to your subscription if you haven't already), then expand the list of Azure web sites.
2. Right-click on the Azure web site to which you are deploying and click on the View Settings menu.
3. Around the middle of the page you will see a Connection Settings section. Go in there, change your connection string value, then click the Save button at the top of the page.
You're good to go at that point. Just republish your application and give it a try - everything should be working at that point. Hopefully this saves someone some time trying to find this info.