Technical documentation - Azure SSMS migration

 

Migrating database from SQL to Azure. 2

Create a .bacpac file of the database (DB) using SQL Server Management SSMS. 2

Import the .bacpac file using SSMS. 2

Run the script to authorize the authentication to Azure. 3

 

Migrating database from SQL to Azure

Create a .bacpac file of the database (DB) using SQL Server Management SSMS

  1. Open SSMS and login. Right click on the database you want to create a backup for and choose Tasks -> Export Data-tier Application…

 

  1. Introduction: Click Next,

Export Settings: choose a location for where you want the .bacpac file to be saved.

Summary: Click Next,

Results: Click Done.

Import the .bacpac file using SSMS

  1. Open SSMS and login. Right click on the Databases folder and choose Import Data-tier-Application…

 

 

  1. Introduction: Click Next,

Export Settings: choose the .bacpac file that you created.

Summary: Click Next,

Results: Click Done.

 

Run the script to authorize the authentication to Azure

 

  1. To run the script, you need to ensure that the application is system assigned in Azure

 

 

 

 

  1. And make sure that you have access rights to run the script on the Virtual Machine (VM).

 

 

 

 

  1. The script needs to be run on each database used by the application in either SSMS or Azure Data Studio (ADS).

 

Roles can vary for the script, to be sure the access is allowed use db_owner. (Might change later).

 

CREATE USER [Name_of_virtual_machine] FROM LOGIN [Azure_Server_User] ALTER ROLE db_owner ADD MEMBER [Name_of_virtual_machine]

 

 

The database is now imported to Azure and the correct authentication is used.