I'm trying to import a bacpac file/data-tier application which was created from a local SQL database and I'm running into the following error:
Error encountered during the service operation. Could not import package. Warning SQL0: A project which specifies SQL Server 2012 as the target platform may experience compatibility issues with SQL Azure. Error SQL72014: .Net SqlClient Data Provider: Msg 40511, Level 15, State 1, Line 2 Built-in function 'newsequentialid' is not supported in this version of SQL Server. Error SQL72045: Script execution error.
How can I fix or work around this error?
Yeah, Azure only supports newid()
because apaprently newsequentialid()
is machine-dependent. Makes sense, I suppose, but what a pain!
You can work around this with this procedure:
newsequentialid()
with newid()
You'd be mostly done here except that there's a checksum in Origin.xml which will now fail because you've monkeyed with the file contents.
You have to recalc the checksum; I did this with PowerShell
Get-FileHash '.\model.xml' -Algorithm SHA256
Then open Origin.xml and replace the hash in the Checksums section.
Copy your modified Origin.xml back into the zip and rename the file back to .bacpac. It will now be possible to import without issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With