Sitecore Azure Deployment may fail if source databases are Microsoft Azure SQL Databases


Description

When performing regular deployment to an Editing or Delivery Farm using Sitecore Azure module 3.0 or later, the deployment process may fail with the following error:

ERROR Sitecore.Azure: Deploy database error. Retry 1
Exception: System.Data.SqlClient.SqlException
Message: Invalid object name '<SqlServerTableName>'.
Source: .Net SqlClient Data Provider
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader()
   at System.Data.SqlClient.SqlCommand.ExecuteReader()
   at Sitecore.Azure.Managers.Pipelines.DeployDatabase.TransferData.TransferDataWorker(Table table, Database targetDatabase)
   at Sitecore.Azure.Managers.Pipelines.DeployDatabase.DeployDatabasePipelineProcessor.DoDeploy[T](Func`3 func, Int32 repeat, IEnumerable`1 objects, Database targetDatabase, Action`1 exceptionCallBack)

This error is caused by the fact that the Sitecore Azure module does not support Microsoft Azure SQL Databases as source databases for deployment. 

Solution

To resolve the issue, perform the following actions:

  1. Download one of the following Sitecore patches:
  2. Place the Sitecore.Support.390508.dll assembly into the /bin directory of your website.
  3. Place the Sitecore.Support.390508.config file into the /App_Config/Include directory.
  4. Re-run the deployment process.