Azure website cannot access Azure DB Azure website cannot access Azure DB azure azure

Azure website cannot access Azure DB


I know this is a really old post, but I just battled with the same issue...

I had the same issue and although I don't understand it, I have found that if I am currently logged in (on my site, not Azure console), I need to log out and then back in again and this database error goes away. It makes no sense to me, but it is what works for me after I deploy. I have had many times where I have deployed and everything works great (no need to logout/login). Sometimes it jumps into this mode. Not sure what is going on there.

It has nothing to do with the connection strings in your web.config - they are all being transformed properly.


It appears that your application is expecting to be able to set up a database using an attached file in your project on a local instance of SQL Server Express. The key line in your error message is:

The connection string specifies a local Sql Server Express instance using a database location within the application's App_Data directory.

You probably need to update the connection string in your configuration file to match the connection string in your Azure website. This information can be obtained in the Azure dashboard once you set up the website with a SQL Server, and be set through the same dashboard.

Here's good instructions for doing that: http://blog.davidebbo.com/2012/09/managing-database-connections-in-azure.html