SQL Server - Bacpac import issue

917 views Asked by At

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

1

There are 1 answers

2
Alberto Morillo On

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.