You can migrate SQL Server to Azure SQL Database with four methods. A BACPAC file moves one database with downtime. Azure Database Migration Service completes an offline migration from the Azure portal. Transactional replication works while the source remains online. Migration software exports objects as SQL scripts when no server is left. Update the statistics and test the application afterward.
Teams that migrate SQL Server to Azure want to retire old hardware and stop patching servers. Azure SQL Database also adds built in high availability and monitoring.
Most guides follow one tool and miss the limits. Few explain how logins, SQL Agent tasks and large BACPAC files behave in Azure.
This guide explains four methods to move SQL Server databases to Azure SQL Database, with the checks before the move and the tasks after it.
Microsoft names Azure Database Migration Service as a recommended tool in its SQL Server to Azure SQL Database migration overview.
Why Migrate SQL Server to Azure SQL Database?
Three reasons explain most moves to Azure:
- Hardware. Azure removes the cost of servers, storage and replacement cycles.
- Availability. Azure SQL Database includes built in high availability, threat detection and workload monitoring.
- Licensing. Azure Hybrid Benefit applies to the vCore purchasing model of Azure SQL Database.
Microsoft states that Windows logins are not supported in Azure SQL Database. Create a login from Microsoft Entra ID and recreate your SQL logins by hand.
Which Path Suits Your Database?
Choose a path by situation:
| Situation | Path |
|---|---|
| One small database and downtime is acceptable | BACPAC file |
| Several databases and a managed service | Azure Database Migration Service |
| Database cannot stop in production | Transactional replication |
| Only an MDF file and no working server | SQL script export |
Which Checks Come Before the Move to Azure?
Seven checks come first:
- Compare the Database Engine features of your database with the features Azure SQL Database accepts.
- Record the size of every database and the downtime that the business accepts.
- Create a backup of every database. Scripts for full, differential and log backups sit in the Explore Different Types of Backups in SQL Server guide.
- List the Windows logins, SQL logins and SQL Agent tasks of the application.
- Create the Azure SQL logical server and add your IP address to its firewall.
- Confirm that port 1433 is open when you connect from behind a corporate firewall.
- Assess the source with Azure Migrate. Microsoft retired Data Migration Assistant on 16 July 2025.
Microsoft states that SQL Agent tasks are not directly supported in Azure SQL Database. Use elastic jobs instead. Choose SQL Server on Azure virtual machines when you need FileStream, FileTable or PolyBase.
4 Ways to Migrate SQL Server to Azure SQL Database
Microsoft tools cover three methods and the fourth uses software for MDF files.
| Method | Downtime | Main limit |
|---|---|---|
| BACPAC File | Yes | Large files need SqlPackage |
| Azure Database Migration Service | Yes for offline mode | Logins and TDE do not migrate |
| Transactional Replication | Minimal | Complex setup and push subscriptions only |
| SQL Script Export | Yes | Trial record limit |
Method #1: Import a BACPAC File (Free, Needs Downtime)
A BACPAC file stores the schema and data of one database. Microsoft lists the BACPAC route as an alternative that requires downtime because data is exported at the source and imported at the destination. Seven steps move ShopDB:
- Right click ShopDB in Object Explorer and select Tasks and then Export Data-tier Application.
- Select Save to local disk and type a path that ends in .bacpac.
- Click Next and then Finish.
- Upload the BACPAC file to a container in Azure Blob storage.
- Open your Azure SQL logical server in the Azure portal and select Import database.
- Select the BACPAC file from blob storage and set the database size and administrator credentials.
- Click OK and watch Import/Export history until the status shows Completed.
For large databases use SqlPackage on a machine with enough disk space:
SqlPackage /a:import /tcs:"Data Source=<serverName>.database.windows.net;Initial Catalog=ShopDB;User Id=<userId>;Password=<password>" /sf:ShopDB.bacpac /p:DatabaseEdition=Premium /p:DatabaseServiceObjective=P6
Microsoft recommends SqlPackage for most production imports. BACPAC files over 150 GB can fail in the Azure portal with the message File contains corrupted data.
Note: Import fails when Allow access to Azure services is set to OFF. The imported database retains the compatibility level of the source and uses geo redundant backup storage by default.
Method #2: Use Azure Database Migration Service (Free Tool, Managed Offline Migration)
This managed service moves databases to Azure data platforms. Microsoft marks offline migration as supported for Azure SQL Database in the Azure portal. Schema migration works and login migration does not. Six steps finish the move:
- Create the Azure SQL Database server and an empty target database.
- Create a migration service resource in the Azure portal.
- Connect the service to the source SQL Server.
- Connect the service to the Azure SQL Database target.
- Select the databases and tables to move.
- Start the migration and follow its status in the portal.
Note: Recreate SQL logins by hand after the move. Microsoft states that the service does not migrate logins or TDE settings.
Method #3: Replicate Data With Transactional Replication (Free, Source Remains Online)
Transactional replication copies data to Azure SQL Database as the data moves. Users continue on the source and Microsoft names this method for databases that cannot stop in production. Five steps set it up:
- Install the latest SQL Server Management Studio because older versions cannot set up Azure SQL Database as a subscriber.
- Right click Replication in SSMS and select New Publication.
- Select Transactional publication and the tables to replicate.
- Add a Push subscription that points to the Azure SQL Database server.
- Start the Snapshot Agent and watch the sync.
Note: Microsoft states that only push subscriptions work with Azure SQL Database and that snapshot creation locks the tables until it finishes. Schedule the snapshot in a quiet period.
Method #4: Export SQL Server Objects as Scripts for Azure With EmailDoctor (Free Preview, Paid Export)
Teams without a working source server open the MDF file with EmailDoctor SQL Server Data Migration Tool. The migration software scans the file and exports objects as SQL Server compatible scripts that you execute in SSMS on the Azure SQL Database server.
Vendor notes describe moves between SQL Server instances and do not name Azure. Test the script on a small database in Azure before you move production data.
Trial mode previews every object. Exports in trial stop at 25 records per table and 5 other categories until you buy a license.
Open the MDF File
Five steps scan the file and show its objects:
- Open the software on a Windows PC and choose Offline mode.
- Press Browse and select the MDF file.
- Select Quick Scan when the file is healthy and Advance Scan when it is damaged.
- Press OK and dismiss the message after the scan.
- Expand the tree and inspect tables, views and procedures.
Export the Objects as Scripts
Four steps create the script file:
- Click Export at the top.
- Select SQL Server Compatible SQL Scripts as the export type.
- Choose With Schema & Data and save the script file.
- Open the file in SSMS, connect to the Azure SQL Database server and execute it.
Note: Online mode connects to a live SQL Server instance when the source still works.
Which Tasks Follow the Move?
Four tasks apply to every method:
- Refresh the statistics with a full scan as Microsoft recommends:
UPDATE STATISTICS dbo.Orders WITH FULLSCAN;
- Create the logins and users that the application needs.
- Replace SQL Agent tasks with elastic jobs.
- Point the connection strings of the application to the Azure SQL Database server and execute your validation tests.
Microsoft states that some features work only after you raise the database compatibility level. Test the application on a copy before you raise it.
Which Problems Stop a Move to Azure?
Five problems stop a move to Azure:
| Problem | Reason | Fix |
|---|---|---|
| Import fails in the portal | Allow access to Azure services is OFF | Use SqlPackage from an Azure virtual machine |
| File contains corrupted data | BACPAC file is over 150 GB | Import with SqlPackage |
| Not enough space on the disk | Import needs about three times the database size | Use a machine with more free disk space |
| Cannot connect from the office | Port 1433 is closed | Ask the network team to open port 1433 |
| Windows login fails | Azure SQL Database has no Windows logins | Create a Microsoft Entra ID login |
Frequently Asked Questions
Can I Migrate SQL Server to Azure SQL Database Without Downtime?
Yes. Users continue on the source while Azure SQL Database catches up. Plan the cutover and update the connection strings.
Does Azure SQL Database Support Windows Logins?
No. Microsoft states that Windows logins are not supported. Create a login from Microsoft Entra ID and recreate SQL logins by hand.
Can I Import a BACPAC File Into an Elastic Pool?
Not directly from the Azure portal. Microsoft advises importing with SqlPackage into a database in the pool or importing into a single database and moving it to the pool.
Does a BACPAC Import Keep the Compatibility Level?
Yes. The imported database retains the compatibility level of the source and you can alter it afterward.
Can Azure SQL Database Execute SQL Agent Tasks?
No. Microsoft states that SQL Agent tasks are not directly supported. Use elastic jobs.
Which Azure Service Fits Instance Level Features?
Azure SQL Managed Instance fits migrations of an entire instance with minimal compatibility issues according to Microsoft. SQL Server on Azure virtual machines fits FileStream, FileTable and PolyBase.
Does the Migration Software Support Azure SQL Database?
Vendor notes do not name Azure. Export scripts with the free trial and test them on a small Azure database before you buy.
Is Every Table Exported in the Trial?
No. The trial exports 25 records per table and 5 other categories. A license removes the limit.
Author’s Verdict
BACPAC files suit one small database and cost nothing. DMS suits several databases that can accept downtime.
Transactional replication fits databases that cannot stop but needs more setup. Script export suits cases where only an MDF file remains.
Test the application on Azure before the cutover. Save the source backups for a week.
- Four methods migrate SQL Server to Azure SQL Database.
- BACPAC files need downtime.
- Azure Database Migration Service completes an offline migration.
- Transactional replication works with the source online.
- Script export handles MDF files.
- Recreate logins and replace SQL Agent tasks with elastic jobs.
- Update the statistics after the move.