Tutorial: Assess and Migrate with Azure Data Studio¶
Duration: 1-2 hours Prerequisites: Azure Data Studio, on-premises SQL Server, Azure subscription Targets: Azure SQL Database, Azure SQL Managed Instance, or SQL Server on Azure VM Migration type: Assessment and offline/online migration
What you will accomplish¶
In this tutorial, you will:
- Install Azure Data Studio and the Azure SQL Migration extension
- Connect to your on-premises SQL Server
- Run a compatibility assessment for all three Azure SQL targets
- Review SKU recommendations based on workload performance data
- Generate a migration readiness report
- Execute a migration to your chosen target
Prerequisites¶
- On-premises SQL Server 2008 or later
- Azure subscription with Contributor access
- Azure Data Studio (latest version)
- Network connectivity between your workstation and the SQL Server instance
- An Azure SQL target provisioned (or willingness to provision one during the tutorial)
Step 1: Install Azure Data Studio¶
Download and install¶
Download Azure Data Studio from https://learn.microsoft.com/azure-data-studio/download for your platform (Windows, macOS, or Linux).
Install the Azure SQL Migration extension¶
- Open Azure Data Studio
- Click the Extensions icon in the left sidebar (or press
Ctrl+Shift+X) - Search for Azure SQL Migration
- Click Install
- Restart Azure Data Studio if prompted
Extension version
The Azure SQL Migration extension is actively developed. Ensure you have the latest version for the most accurate assessment and migration capabilities.
Step 2: Connect to on-premises SQL Server¶
- Click New Connection in Azure Data Studio
- Enter your on-premises SQL Server connection details:
- Server:
your-server-nameoryour-server-name\instance - Authentication: Windows Authentication or SQL Login
- Database: Leave blank to connect to the instance
- Server:
- Click Connect
Step 3: Run assessment¶
Start the migration wizard¶
- Right-click the server connection in the Connections panel
- Select Manage
- In the management dashboard, find the Azure SQL Migration section
- Click Assess and Migrate
Select databases¶
- The wizard displays all databases on the instance
- Select the databases you want to assess (you can select multiple)
- Click Next
Select target platform¶
- Choose your target:
- Azure SQL Database -- for fully managed, database-level PaaS
- Azure SQL Managed Instance -- for instance-level PaaS with near-100% compatibility
- SQL Server on Azure Virtual Machine -- for full IaaS control
- You can assess for multiple targets simultaneously
- Click Next to start the assessment
Review assessment results¶
The assessment report shows:
Assessment summary¶
- Ready: Databases with no blocking issues for the selected target
- Ready with conditions: Databases with minor issues that can be resolved
- Not ready: Databases with blocking issues requiring remediation
Issue details¶
For each database, the assessment lists:
| Issue severity | Description |
|---|---|
| Error | Blocking issues that prevent migration |
| Warning | Non-blocking issues that may affect functionality |
| Information | Feature parity differences (no impact on migration) |
Common issues and resolutions¶
| Issue | Target affected | Resolution |
|---|---|---|
| Cross-database references | SQL DB | Consolidate databases or use elastic query |
| CLR assemblies (UNSAFE) | SQL DB, SQL MI | Rewrite in T-SQL or convert to SAFE |
| Linked servers | SQL DB | Use ADF or REST endpoints |
| FILESTREAM usage | SQL DB, SQL MI | Migrate files to Azure Blob Storage |
| SQL Agent jobs | SQL DB | Convert to Elastic Jobs or ADF |
| Windows authentication | SQL DB | Switch to Entra ID |
| Service Broker | SQL DB | Use Azure Service Bus |
| Database mail | SQL DB | Use Logic Apps or Azure Functions |
Step 4: Get SKU recommendations¶
Collect performance data¶
The extension can collect performance data to recommend the right Azure SQL SKU:
- In the assessment wizard, click Get Azure recommendation
- Choose data collection method:
- Collect performance data now: Runs a lightweight data collector on the source instance
- Import existing data: Use previously collected performance data
- For real-time collection, set the collection duration (recommended: 24+ hours for production workloads, 10 minutes minimum for this tutorial)
- Click Start
Review recommendations¶
After data collection, the extension recommends:
- Target type: SQL DB, SQL MI, or SQL on VM
- Service tier: General Purpose, Business Critical, or Hyperscale
- Compute size: vCores or DTUs based on CPU utilization
- Storage size: Based on current database size plus growth projections
- Estimated monthly cost: Including Azure Hybrid Benefit if applicable
Example recommendation output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Database: AdventureWorks
Recommended target: Azure SQL Managed Instance
Service tier: General Purpose
Compute: 8 vCores (Gen5)
Storage: 256 GB
Estimated cost: $1,200/month (with AHB)
Confidence: High (based on 24h perf data)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Collect data during peak hours
For accurate SKU recommendations, collect performance data during representative workload periods including peak hours, batch jobs, and month-end processing.
Step 5: Execute migration¶
Configure target¶
- Click Migrate on a database that passed assessment
- Sign in to your Azure account
- Select your target Azure SQL resource:
- For SQL DB: Select the server and database
- For SQL MI: Select the managed instance
- For SQL on VM: Select the virtual machine
- Enter target credentials
Select migration mode¶
| Mode | Downtime | Use when |
|---|---|---|
| Online | Minutes | Production databases requiring minimal downtime |
| Offline | Hours | Dev/test or when a maintenance window is available |
Configure data source¶
For online migration to SQL MI:
- Select Azure Blob Storage as the backup location
- Enter the storage account details and SAS token
- The extension will guide you through backup configuration
For offline migration:
- Select the migration method (BACPAC, backup/restore, or DMS)
- Configure the source connection
Start migration¶
- Review the migration summary
- Click Start Migration
- Monitor progress in the Azure SQL Migration dashboard
Step 6: Monitor and complete¶
Monitor in Azure Data Studio¶
The Azure SQL Migration extension shows:
- Migration status: InProgress, ReadyForCutover, Succeeded, Failed
- Backup restore progress: Percentage of backups restored
- Log shipping lag: For online migrations, time lag between source and target
- Pending log backups: Number of log files waiting to be applied
Complete cutover (online migration)¶
When the migration status shows ReadyForCutover:
- Stop application writes to the source database
- Wait for replication lag to reach zero
- Click Complete Cutover in the migration dashboard
- Update application connection strings
- Verify application functionality
Step 7: Validate migration¶
Schema validation¶
-- On target: Compare object counts with source
SELECT type_desc, COUNT(*) AS cnt
FROM sys.objects
WHERE is_ms_shipped = 0
GROUP BY type_desc
ORDER BY type_desc;
Data validation¶
-- Compare row counts for key tables
SELECT
SCHEMA_NAME(t.schema_id) + '.' + t.name AS table_name,
SUM(p.rows) AS row_count
FROM sys.tables t
JOIN sys.partitions p ON t.object_id = p.object_id
WHERE p.index_id IN (0, 1)
GROUP BY SCHEMA_NAME(t.schema_id), t.name
ORDER BY table_name;
Application validation¶
- Update connection strings in your application configuration
- Run smoke tests against the migrated database
- Monitor for errors in application logs
- Compare query performance with baseline measurements
Step 8: Export assessment report¶
Generate a report for stakeholders:
- In the assessment results, click Export Report
- Choose format: JSON or CSV
- The report includes:
- Database inventory
- Compatibility assessment per target
- Feature parity gaps
- SKU recommendations
- Estimated costs
Troubleshooting¶
| Issue | Resolution |
|---|---|
| Extension not showing in Azure Data Studio | Update Azure Data Studio to latest version and reinstall the extension |
| Assessment shows no databases | Check SQL Server connectivity and permissions (sysadmin or db_owner required) |
| Performance data collection fails | Ensure the user has VIEW SERVER STATE permission |
| SKU recommendation shows "Low confidence" | Collect performance data for a longer period (24+ hours recommended) |
| Migration fails with permission error | Ensure the Azure account has Contributor role on the target resource |
| Online migration not available | Online migration requires Premium DMS tier for SQL MI |
Related¶
- Schema Migration
- Data Migration
- Tutorial: DMS Migration
- Azure SQL DB Migration
- Azure SQL MI Migration
- Best Practices