Cannot access SQL Azure DB from Azure website but same connection string works from local website Cannot access SQL Azure DB from Azure website but same connection string works from local website azure azure

Cannot access SQL Azure DB from Azure website but same connection string works from local website


I'm not sure which portal you're using, but... in the preview portal (portal.azure.com), your database settings page will have a link to the server, and there you'll find firewall settings. And aside from IP ranges, there's an option to allow Azure services to have access to your database. You'll need that enabled.

Same thing in manage.windowsazure.com - the settings are accessible through the Configure tab.


I needed to update my website settings as in Cannot Access Azure DB Server from Azure Website, needed to copy-paste the whole connection string as the second parameter. The third parameter in these settings that worked for me was SQL Server.

This makes sense in my case because I deploy on Azure through github. Obviously when you upload my web.config on github, I take my database password out, the connection string from uploaded web.config as uploaded on github cannot be used to gain access to the database. So it makes perfect sense to specify the connection string(s) on Azure website, because the information I provide there remains private. Presumably, this is done using XDT as shown here.

Firewall settings modifications were unnecessary.


The error you are getting is not due to a firewall ACL issue with SQL Azure. That error would say something like this error in the screenshot below. You must have an issue instead with your connection string.

Do also make sure in your SQL Azure server ACL settings you have the option checked to allow Azure services to connect to it.

enter image description here