0

I have a .bacpac file of database (created from azure). The database contains master key and certificate attached. Now, I have to import data into my local instance, I am using import-data tier feature but it gives error related to you have already database attached and create master key first. I didn't understand because I don't have that database in my local yet and .bacpac already has master key.

Why does it say: "create master key first" ?

This is the error screenshot:

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
SSD
  • 1,041
  • 3
  • 19
  • 39

1 Answers1

0

Try to remove the master key and the credential object from the bacpac prior to import it to the local SQL Server instance. Here you will find a script provided by Microsoft to remove the master key from the bacpac and you will find there other workarounds for this issue.

Alberto Morillo
  • 13,893
  • 2
  • 24
  • 30
  • I tried powershell sript mentioned in above link. it produced patched bacpac file. and when import started, it started giving same error. – SSD May 02 '22 at 14:53
  • Please try to update SSMS to the latest version and import the bacpac to a SQL Server 2019 instance with the latest cumulative update applied. – Alberto Morillo May 02 '22 at 19:44