Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to import SQL Azure V12 BACPAC: "type Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider is not valid"

I am trying to import the exported BACPAC from an SQL Azure (v12) database into a local SQL Server 2012 instance, but I keep getting the error below. I have tried installing the DAC and SSDT updates linked from this blog post, but it's not helping.

How can I fix this?

TITLE: Microsoft SQL Server Management Studio
------------------------------

Count not load schema model from package. (Microsoft.SqlServer.Dac)

------------------------------
ADDITIONAL INFORMATION:

Internal Error. The database platform service with type Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider is not valid. You must make sure the service is loaded, or you must provide the full type name of a valid database platform service. (Microsoft.Data.Tools.Schema.Sql)

------------------------------
BUTTONS:

OK
------------------------------
like image 238
Ivan Zlatev Avatar asked Feb 17 '15 16:02

Ivan Zlatev


People also ask

How do I import a Bacpac file to Azure SQL?

To import from a BACPAC file into a new single database using the Azure portal, open the appropriate server page and then, on the toolbar, select Import database. Select the storage account and the container for the BACPAC file and then select the BACPAC file from which to import.

How do I import a Bacpac file from SQL Server command line?

Import BACPAC File to On-Premise SQL Server :C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin> SqlPackage.exe /a:import /sf:\\Userdb0. bacpac /tsn:SERVER-SQL\DEV2016 /tdn:Azure_Test /p:CommandTimeout=2400.


3 Answers

Updated: The new SQL Server Management Studio Preview is the best way to Import to Azure SQL DB. It has support for all the latest Azure SQL DB features and validations. In addition it has a standalone web installer that is automatically updated each month as new features become available. Given comments below mentioning the difficulty of installing a CU update, this would be a simpler & quicker solution to the problem.

Original Answer: If you are using SQL Server Management Studio to perform the Import, you must have SSMS 2014 CU5 or CU6 installed. Information on installing CU6 is available here. The error shown in your question indicates you're using an older version of SSMS.

**Update: ** In response to Martin's answer below, I'd like to clarify 2 things.

  1. SSMS for SQL Server 2014 is the only version of SSMS with full support of the new Azure SQL DB v12 features, notably Import/Export against this target. This is because v12 has (almost) feature parity with SQL Server 2014 and older versions of the tooling do not have support for this. Note that SSMS 2014 is fully backwards compatible with SQL Server 2005 and up.

  2. There was a separate, temporary issue that caused problems with databases upgraded Azure SQL DB v12. This has been resolved and the correct place to find information about solving this are in section C3 of the Plan and Prepare to Upgrade page. In summary if you've exported a bacpac that is failing to import due to this issue you can download the latest DacFramework.msi from here to fix this issue in SSMS.

Full disclosure: I work on the SQL Server tools team.

like image 124
Kevin Cunnane Avatar answered Oct 21 '22 05:10

Kevin Cunnane


To fix import error with [sys].[script_deployment_databases] from exported V12 Database you have to install:

  1. CU13
  2. Microsoft SQL Server Data-Tier Application Framework (February 2015) (you must install BOTH the x64 and x86 versions).

EDIT: CU13 is not necessary, just try second link first!

like image 26
haldyr Avatar answered Oct 21 '22 05:10

haldyr


Install the following and it will work!
1) Have you installed Cumulative Update 5 for SQL Server Management Studio 2014. http://support2.microsoft.com/kb/3011055
2) Microsoft SQL Server Data-Tier Application Framework (February 2015) (you must install BOTH the x64 and x86 versions). http://www.microsoft.com/en-us/download/details.aspx?id=45886

like image 5
ActiveA Avatar answered Oct 21 '22 03:10

ActiveA