/ Microsoft Azure

Timeout expired while publishing to Azure SQL Database via SSDT

It turns out there is registry setting that needs to be tweaked to help get SQL Server Data Tools (SSDT) to publish to Azure in some circumstances (i.e. mine!).

I hit a frustrating problem of continually getting a timeout error when publishing my database using SQL Server Data Tools (SSDT) to Azure:

Failed to import target model ...Unable to reconnect to database

Timeout Expired. The timeout period expired prior to completion of the operation or the server is not responding.

I could rule out that I had the publish settings correct because when I pressed the Test Connection button in the publish wizard, it worked fine.

(Note my version of SSDT is 12.0.41025.0, future versions will likely fix this.)

The simple fix

Luckily, the SQL Server Support Blog had a detailed post highlighting that it was a query timeout caused by the limited resources of the Basic Plan in Azure. So:

  • Find registry key HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\SQLDB\Database
  • Update the QueryTimeoutSeconds setting to be 600
  • Restart Visual Studio, and you're away.

This also made the publish faster! Because of the retry mechanism, each query timeout caused another attempt at running it - it would take 5 minutes before the publish aborted and I got the final timeout error. Now, it's done in less than a minute.