Import a BACPAC File to Create a New Database

I used a SQL Express 2016 to import a bacpac file from Azure.
(Export the db from the Azure Portal first). And the SQL Server Management studio 17.

Initially imported into SQL Express 2014 but got some warnings/errors regarding the import, so SQL 2016 works better.

Steps:
1. Access to a bacpac file locally / on azure storage
2. Use the UI wizard in Management Studio. (See below)

To launch the wizard, use the following steps:
  1. Connect to the instance of SQL Server, whether on-premise or in SQL Database.
  2. In Object Explorer, right-click on Databases, and then select the Import Data-tier Application menu item to launch the wizard.
  3. Complete the wizard dialogs: Introduction Page. Import Settings Page.

    Source: Import a BACPAC File to Create a New User Database | Microsoft Docs

I got this error when starting up the website:
System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 – The certificate chain was issued by an authority that is not trusted.

Solved the error by setting TrustServerCertificate=false in the connectionstring.

More info here:
https://stackoverflow.com/questions/17615260/the-certificate-chain-was-issued-by-an-authority-that-is-not-trusted-when-conn

Leave a Reply

Your email address will not be published. Required fields are marked *