Compartir a través de


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.

Comments

  • Anonymous
    January 08, 2015
    m88 : http://m88en.com
    M88.com offer online sports games Asia, Sports Betting Asia, Sports Betting Sites Asia.
    m88asia : http://m88en.net
    Link to M88BET phone: m88en.com. – Register and Open Betting Account and Membership M88BET.
    m88bet : http://www.linkm88vip.com
    MANSION88 the house is one of the largest and most prestigious. Appeared quite early in the Asian market, the so-MANSION88 currently attracts more players.
    link m88 : http://m88wiki.com
    Home the M88 is the official sponsor of the football club in the Premier League
    Wish you happy with the new M88
    m88 casino online : http://m88free.com