There are two issues faced by me during restoring the bacpac file.
ERROR 1: Create User with Password
Could not import package Error:SQL72045 script execution error. CREATE USER [usersample] WITH PASSWORD = sasaas%$##$#$#$#$#$
To resolve the above issue, this property is missing in bacpac azure DB export.
1.Rename your .bacpac file to .zip
2.Export the zip content to a new folder
3.Modify the model.xml and add <Property Name=”Containment” Value=”1″ />
4.its the time to change the check sum
- download dacchksum.exe from this urlhttps://github.com/gertd/dac/tree/master/drop/debug
- 6. Copy dacchksum.exe in the same directory as .bacpac resides
7.Open Command Prompt and then navigate to the old directory, then execute the following command to generate the new check sum
Command: dacchksum.exe /i:Azurebackup.bacpac
Copy the checksum values from Calculated:
- open origin.xml then add the new Checksum then save the file.
- Compress the folder as zip then rename the .zip to .bacpac
- its done. You can start importing in Sql Server 2016 successfully
Error 2: CREATE MASTER KEY
This is second error faced in restoring the bacpac file.
Could not import package.
Error SQL72014: .Net SqlClient Data Provider: Msg 15578, Level 16, State 1, Line 1 There is already a master key in the database. Please drop it before performing this statement.
Error SQL72045: Script execution error. The executed script:
CREATE MASTER KEY;
to resolve this issue Follow Option 2 from