Azure website cannot access Azure DB

前端 未结 2 1673
清歌不尽
清歌不尽 2020-12-06 11:41

This error drives me crazy and I can\'t even reproduce it!

I\'ve published my website to Windows Azure and SQL Azure and it worked great. All the sudden and it doesn

相关标签:
2条回答
  • 2020-12-06 12:17

    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

    0 讨论(0)
  • 2020-12-06 12:19

    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.

    0 讨论(0)
提交回复
热议问题