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

8

49

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
------------------------------
Suzannasuzanne answered 17/2, 2015 at 16:49 Comment(0)
M
41

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.

Michale answered 17/2, 2015 at 18:46 Comment(9)
There is some work to be done on making these "hotfixes" more available. I can't believe that I'm being e-mailed a link to download the hotfix like I'm some 18th century French peasant.Levona
Using SSMS for SQL Server 2014 worked for me. When trying to use SSMS bundled with 2012, I kept getting errors like Warning SQL72012: The object [PRIMARY] exists in the target... when trying to import a BACPAC file from SQL Azure.Mcentire
I was unable to install CU6. no info other than There are no SQL Server instances or shared features that can be updated on this computer. Maybe it's up to date? I don't know, it's not telling me that. Why is my SSMS installation is unselectable as a feature to modify via the CU6 installer? I see instances and two boxes, but they are unclickable. one of them is MSSQLSERVERBemuse
@Bemuse - I would guess that CU requires an existing release that it updates. The new best practice is to install the SSMS Preview, which has all the latest support, does not require an engine install, and gets automatic updates every month. You can get it from msdn.microsoft.com/en-us/library/mt238290.aspxMichale
As mentioned below, the problem for me was that I needed to install BOTH x86 and x64 versions of DacFramework.msi!Hard
Preview SSMS as linked in the update worked. Thanks @KevinCunnaneSelfcommand
@KevinCunnane Is this going to come to VS2015? I have not installed SSMS on my machine since 2008, since all needed SQL Tools are available in VS Studio. I can not find anything to take a SQL Azure export and import it locally.Brindle
@Brindle SqlPackage.exe is installed in VS2015, which supports command line Import/Export. Longer term we're looking to align features across SSMS & SSDT more, so it's possible but not firmly funded on any roadmap yet. For right now dacpac publish/extract work in VS, but the Azure integration needed to properly support Import scenarios is missing so would need to be implemented. I'd recommend opening a Connect bug/DCR to help give requests like this visibility.Michale
I have SSMS 2014 and i resolved this issue by installing BOTH DacFramework (x86 and x64)!Cheekpiece
C
24

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!

Caledonian answered 9/3, 2015 at 7:31 Comment(3)
@Sergey I was sceptical, but alas, glad to be proven wrong.Hertz
In my case, CU13 was not needed, but the Data-Tier application framework was (only installing the 32 bit version worked ; I use the 32 bits version of SQL server express 2014 and SSMS)Plausive
#2 fixed first issue but introduced another which was like "the internal target plates does not support schema file version 3.5..." I then installed SSMS v17 which workedAperture
M
5

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

Menard answered 26/3, 2015 at 19:47 Comment(1)
Key thing for me was adding both the x64 & x86 versions. Small but very vital key to get this working. Thank you!Ehudd
O
2

I had the same problem with my dataabse backup from SQL Azure (v12).

I've installed Microsoft® SQL Server® Data-Tier Application Framework (February 2015) (in order to work correctly you will need install BOTH the x64 and x86 versions). First I've installed x64 version and tried to restore the DB - but it didn't work. After that I've installed x86 version and I could successfully restore the database.

My SQL Server version: Microsoft SQL Server 2014 - 12.0.2269.0 (X64). OS: Windows 10 x64 build 10240.

Tnanks.

Oxytocic answered 6/11, 2015 at 9:4 Comment(0)
O
2

BacPac restore from Azure DB fails after installing latest SQL Server Management Studio 2016 Preview. Solution was to set "Contained Database Authentication" = 1 for my local SQL DB instance. Read about solution here or run this script on your local instance:

USE master GO RECONFIGURE GO sp_configure 'CONTAINED DATABASE AUTHENTICATION', 1

Osyth answered 1/6, 2016 at 16:39 Comment(1)
This worked for me!!! perfect thank you. For anybody else reference This fix worked for me and I'm running v17.9.1 of MSSMS. Although I did have to run the statements individually without the GO's. Thank youCarrelli
H
2

I was using wrong SqlPackage.exe path.

Does not work:

C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe

Works:

C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin\SqlPackage.exe
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130\SqlPackage.exe
Henn answered 8/8, 2016 at 6:51 Comment(0)
C
1

I'm having the same issue.

Installing Cumulative update package 6 as suggested here helps to avoid the first bug but just to get stuck in the next one.

Related to this topic:

SQL Azure import of bacpac does not work after upgrade to v12

it's a bug Microsoft has no fix or workaround yet.

Edit: SQL Management Studio 2014 is required to restore (2012 doesn't work)

If there's one, I think the thread will be updated.

Edit: In the above mentioned link you now can find a workaround: You need to create a copy of your V12 database. This copy can be exported and reimported on your local sql server 2014.

Just updating the tools doesn't help.

Claussen answered 18/2, 2015 at 0:16 Comment(3)
Hi Martin, I have updated my response to hopefully cover your issues. Let me know if there's anything I haven't covered and I will update further.Michale
Hi @KevinCunnane, thank you for your answer! I've updated the DAC, created a new Backup of my Azure V12 database and tried to import it. Unfortunately I'm still getting the same error as before. The error message is too long for here. The error codes are: Warning SQL72012, Error SQL72014, Error SQL72045Claussen
Martin, if the issue is related to CREATE TYPE [sys].[script_deployment_databases], then it should be fixed by installing that latest Dac update and running Import via SSMS 2014. You should also be able to import using the Import/Export service in the portal. If you are experiencing this after updating Dac, please contact support as mentioned in the "Plan and Prepare to Upgrade" page and they can route it through the correct channels.Michale
A
0

I'm using version 11.0.2100.60 and had the same issue. Installed Microsoft® SQL Server® Data-Tier Application Framework (February 2015). All worked fine after that.

Algeria answered 2/11, 2015 at 22:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.