I have created a new "Database" project in Visual Studio 2013. I have set the Target platform to "Windows Azure SQL Database". The project is nearly empty, with the exception of one .sql file to create a Schema.
When I try to publish the project, it takes several minutes and ends with:
Creating publish preview...
Failed to import target model [database_name]. Detailed message Unable to reconnect to database: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
I have tested the connection string, and it works.
What do I need to do to publish to Azure? Thanks.
Like Hesham mentioned in the comments, I also had this issue with the new Basic tier of Azure SQL Database. Switching the tier to Standard S0 size fixed the issue. So if you're having issues with the Basic tier, try scaling up to publish, then scale back down when you're finished.
Check this answer from MSDN forum, worked with me perfectly!
In order to change the command timeouts used in Visual Studio 2013 you
will need to change the following registry setting:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\SQLDB\Database\QueryTimeoutSeconds
Source:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/7e869f10-529b-41af-b54f-709a420308f6/publish-database-to-a-new-basic-scale-db-from-vs2013-times-out?forum=ssdsgetstarted
I had experienced the same problem and was able to resolve it by changing the 'Connect Timout' value to 0 in the 'Publish Database' dialog.
- In the 'Target database connection:' field, click 'Edit...'.
- In 'Connection Properties' dialog, click 'Advanced...'.
- In the 'Initialization' section, set 'Connect Timeout' to 0.
Link to screencapture...I don't yet have enough points to publish an image. :)
My project had been taking 2-3 minutes before failing with the timeout. After the setting change, it successfully published within a minute.
I hope that helps.