The short version
Azure SQL Database, Azure SQL Managed Instance and SQL Server on an Azure VM all run the SQL Server engine, but they keep different amounts of SQL Server around it. Azure SQL Database is one database with no instance: no SQL Server Agent, no cross-database queries, no CLR, no Database Mail, no linked servers. Managed Instance is a whole instance run by Microsoft and keeps nearly all of that, minus anything that touches the operating system or a file path (FILESTREAM, xp_cmdshell, CmdExec job steps, BACKUP TO DISK). SQL Server on a VM is plain SQL Server with full OS access, and the patching and high availability are yours to run. If your code uses instance features, start at Managed Instance; if it touches the OS, take the VM.
SQL Server vs Azure SQL Managed Instance vs Azure SQL Database: the difference
Microsoft's Azure SQL overview puts it in one line each: SQL Database "supports most on-premises database-level capabilities", Managed Instance "supports almost all on-premises instance-level and database-level capabilities", and on a VM "you have full control over the SQL Server engine" with "full parity with the matching version of on-premises SQL Server". The first two are PaaS, the third is IaaS. The same page frames the decision as one question: do you want to manage the database, apply patches and take backups yourself, or hand that to Azure.
So "is Azure SQL the same as SQL Server" has three answers: on a VM, yes; on Managed Instance, an instance minus the file system; on SQL Database, one database. The SQL Server to Azure SQL Database guide covers that last case in detail.
Side by side
From the feature comparison for the first two columns, and the Azure SQL overview for the VM column, which is SQL Server itself:
| Azure SQL Database | Azure SQL Managed Instance | SQL Server on Azure VM | |
|---|---|---|---|
| What you get | One database on a logical server | An instance: system and user databases | A Windows or Linux VM with SQL Server installed |
| Cross-database queries | No (elastic query, read-only, preview) | Yes, within the instance | Yes |
| SQL Server Agent | No (elastic jobs) | Yes, with limits | Yes |
| Database Mail | No | Yes | Yes |
| CLR | No | Yes, FROM BINARY only |
Yes |
| Linked servers | No | SQL Server and Azure SQL targets only | Yes |
| Service Broker | No | Yes, cross-instance only between managed instances | Yes |
| FILESTREAM / FileTable | No | No | Yes |
| Distributed transactions (MS DTC) | No (elastic transactions) | Yes | Yes |
BACKUP |
No, automatic backups only | COPY_ONLY to Azure Blob storage |
Yes, manual or automated |
Restore a .bak |
No | Yes, FROM URL |
Yes |
| Windows authentication | No (Microsoft Entra) | Via Microsoft Entra Kerberos; no FROM WINDOWS logins |
Yes |
| Recovery model | Full only | Full only | Any |
| Max size | Up to 128 TB per database | Up to 16 TB per instance (32 TB Next-gen General Purpose) | Up to 256 TB per instance |
| SSRS | No | No, host it on a VM | Yes |
| File system / OS access | No | No | Yes |
Two size details. When a workload outgrows the instance, the Managed Instance resource limits page itself suggests the SQL Database Hyperscale tier. And a Managed Instance holds 100 user databases in General Purpose and Business Critical, 500 in Next-gen General Purpose (same page). A server with 300 small databases does not fit one General Purpose instance.
What Managed Instance still cannot do
These are the gaps to check before choosing it, from the Managed Instance T-SQL differences page:
- FILESTREAM and FileTable are not supported, and a
.bakwith FILESTREAM data fails to restore. xp_cmdshelland extended stored procedures are not supported.- SQL Server Agent runs T-SQL and SSIS steps, but not command shell steps; alerts and proxies are not supported, and Agent can only use one Database Mail profile, named
AzureManagedInstance_dbmail_profile. sp_send_dbmailcannot send@file_attachments.CREATE ASSEMBLY FROM FILEis not supported;FROM BINARYis.- Linked servers reach SQL Server, SQL Database, Managed Instance and Azure Synapse SQL, but not other database engines or files. An Oracle linked server stops here.
BACKUPmust beTO URLandCOPY_ONLY; there are no log or differential backups you take yourself.- Windows logins (
CREATE LOGIN ... FROM WINDOWS) are not supported; use Microsoft Entra logins. - The database runs in the full recovery model; a
SIMPLEdatabase restored there comes back asFULL.
Versions and patching
SQL Database runs the "latest stable Database Engine version" and you match an older SQL Server only through compatibility levels (Azure SQL overview); the feature comparison lists levels 100 to 160 for both PaaS options.
Managed Instance adds an update policy: SQL Server 2022, SQL Server 2025, or Always-up-to-date. The first two keep the internal database format aligned with that SQL Server release, so you can restore a database back to SQL Server 2022 or 2025 and run a Managed Instance link with failover in both directions. Always-up-to-date gets new engine features first, and it is one-way: you cannot switch the instance back, and you lose the restore-to-SQL-Server path. If going back on-premises is your exit plan, choose the policy with that in mind.
On a VM, you pick the version. The Marketplace images go back to SQL Server 2016, and they "deploy at RTM and aren't updated over time" (SQL Server on Azure VM overview). Automated backup and automatic patching of Windows and SQL Server updates exist, but both require registering the VM with the SQL IaaS Agent extension. High availability is also yours: the VM SLA covers the machines, and for the database you build an availability group or a failover cluster instance (Azure SQL overview).
A script that answers it for your database
The table says what each target supports, not what your database uses. So I wrote a small checker that reads a scripted-out database (SSMS "Generate Scripts", plus the server objects: linked servers, Agent jobs, logins) and prints, for every feature it finds, a verdict for each target. It builds on the offline scanner from the Azure SQL Database guide: split on GO, parse with sqlglot's T-SQL dialect for three- and four-part names, regexes for what the parser does not model. The new part is a rules table and resolving linked servers: an OPENQUERY(ERP, ...) counts as Oracle only if ERP was defined with an Oracle provider.
# feature -> (Azure SQL Database, Managed Instance, SQL Server on VM)
RULES = {
"cross-database query (3-part name)": ("NO", "yes, same instance", "yes"),
"linked server to SQL Server": ("NO", "yes", "yes"),
"linked server to another RDBMS": ("NO", "NO", "yes"),
"Database Mail with file attachment": ("NO", "NO", "yes"),
"Agent job, CmdExec step": ("NO", "NO", "yes"),
"CLR assembly from a file path": ("NO", "NO", "yes"),
"BACKUP TO DISK": ("NO", "NO", "yes"),
...
}
SQL_PROVIDERS = {"sqlncli", "sqlncli11", "sqloledb", "msoledbsql", ""}
Each "NO" is a row of the feature comparison or a line on one of the two T-SQL differences pages. The VM column is "yes" throughout because a VM runs SQL Server itself.
The test input is a 51-line script of a made-up billing database written the way these databases usually are: a view joining a CRM database, a month-end procedure that writes to Archive and mails a CSV, a CLR regex assembly loaded from D:\clr, an Oracle linked server for exchange rates, a SQL Server linked server for head-office totals, a bcp export through xp_cmdshell, a nightly Agent job with a T-SQL step and a robocopy step, a Service Broker queue, SIMPLE recovery, a backup to D:\backup, and a Windows login.
Output, sqlglot 30.17.0 on Python 3.12.8, unedited:
$ python where_can_it_run.py billing_scripted.sql
'CREATE ASSEMBLY BillingRegex FROM 'D:\clr\BillingRegex.dll' WITH PERMISSION_SET = SAFE' contains unsupported syntax. Falling back to parsing as a 'Command'.
'CREATE QUEUE dbo.InvoiceQueue' contains unsupported syntax. Falling back to parsing as a 'Command'.
'ALTER DATABASE Billing SET RECOVERY SIMPLE' contains unsupported syntax. Falling back to parsing as a 'Command'.
'CREATE LOGIN [CORP\billing_app] FROM WINDOWS' contains unsupported syntax. Falling back to parsing as a 'Command'.
feature Azure SQL DB Managed Inst. VM found in
cross-database query (3-part name) NO yes, same instance yes batch 2: CREATE VIEW dbo.vInvoiceCustomer AS SE
Database Mail with file attachment NO NO yes batch 3: CREATE PROCEDURE dbo.usp_MonthEnd AS B
cross-database query (3-part name) NO yes, same instance yes batch 3: CREATE PROCEDURE dbo.usp_MonthEnd AS B
CLR assembly from a file path NO NO yes batch 4: CREATE ASSEMBLY BillingRegex FROM 'D:\
linked server to another RDBMS NO NO yes batch 5: EXEC sp_addlinkedserver @server = 'ERP
linked server to SQL Server NO yes yes batch 6: EXEC sp_addlinkedserver @server = 'HQS
OPENQUERY to another RDBMS NO NO yes batch 7: CREATE PROCEDURE dbo.usp_PullErpRates
linked server to SQL Server NO yes yes batch 8: CREATE PROCEDURE dbo.usp_PushTotals AS
xp_cmdshell NO NO yes batch 9: CREATE PROCEDURE dbo.usp_ExportFile AS
Agent job, T-SQL step NO yes yes batch 10: EXEC msdb.dbo.sp_add_jobstep @job_name
Agent job, CmdExec step NO NO yes batch 11: EXEC msdb.dbo.sp_add_jobstep @job_name
Service Broker NO yes yes batch 12: CREATE QUEUE dbo.InvoiceQueue;
SIMPLE / BULK_LOGGED recovery NO NO yes batch 13: ALTER DATABASE Billing SET RECOVERY SI
BACKUP TO DISK NO NO yes batch 14: BACKUP DATABASE Billing TO DISK = 'D:\
Windows login NO NO yes batch 15: CREATE LOGIN [CORP\billing_app] FROM W
Azure SQL Database 15 blocker(s)
Azure SQL Managed Instance 9 blocker(s): Database Mail with file attachment, CLR assembly from a file path, linked server to another RDBMS, OPENQUERY to another RDBMS, xp_cmdshell, Agent job, CmdExec step, SIMPLE / BULK_LOGGED recovery, BACKUP TO DISK, Windows login
SQL Server on Azure VM 0 blocker(s)
The four "Falling back to parsing as a 'Command'" lines are sqlglot warnings, not findings: it has no grammar for those statements, which is why the regexes exist. The four-part INSERT INTO HQSQL.Finance.dbo.BranchTotals was matched to the HQSQL definition and came back as a SQL Server linked server, so Managed Instance can keep it. OPENQUERY(ERP, ...) resolved to the Oracle provider and did not.
Reading the verdict
Nine "NO"s for Managed Instance looks like a VM, but the count is of statements, and they are not equal.
Rewrites with a direct replacement on Managed Instance: the backup becomes BACKUP ... TO URL WITH COPY_ONLY (or you rely on automatic backups), the Windows login becomes a Microsoft Entra login, the CLR assembly is created FROM BINARY instead of from a path, and the SIMPLE recovery line is deleted because the instance runs full recovery anyway.
Redesigns: the mail attachment, the xp_cmdshell bcp export and the robocopy job step all write to or read from a file system the instance cannot reach. The T-SQL differences page points file imports at Azure Blob storage through BULK INSERT and OPENROWSET; the export and the copy have to move out of the database into something that runs outside it.
The real blocker is the Oracle linked server. Managed Instance does not link to other database engines at all. Either the exchange-rate feed arrives another way, or this database goes to a VM.
That last line usually decides it. For SQL Database the picture is simpler and worse: all fifteen, including the cross-database view and the Agent job, which there become elastic query (read-only) and elastic jobs at best.
Pick this if
Azure SQL Database if the application is one database, or several that never query each other, there is no Agent job, CLR, mail or linked server in it (or you are willing to rewrite those), and you want Microsoft to own patching, backups and HA. It also offers serverless compute and elastic pools (Azure SQL overview).
Azure SQL Managed Instance if the databases talk to each other, run Agent jobs, send mail or use Service Broker, and nothing in them needs the file system, FILESTREAM, xp_cmdshell or a non-SQL Server linked server. Pick the update policy before you create it if returning to SQL Server must stay possible.
SQL Server on an Azure VM if the checker leaves a hard "NO" in the Managed Instance column, if you need SSRS on the same box, an older SQL Server version (the Marketplace images go back to 2016), more user databases on one server than a Managed Instance takes, or OS access for agents and tools. Microsoft notes migration to a VM "is no different than moving the databases from one on-premises server to another" (Azure SQL overview); you take back the patching and the HA design with it.
I have left prices out of this page; the cost side is in What a Database Migration Actually Costs. For the moves themselves: SQL Server to Azure SQL Database, Step by Step, SQL Server to Azure SQL Managed Instance and Moving a Local SQL Server Database to Azure.
Sources
- What is Azure SQL? (Azure SQL Database, Managed Instance and SQL Server on Azure VMs compared)
- Features comparison: Azure SQL Database and Azure SQL Managed Instance
- T-SQL differences between SQL Server and Azure SQL Database
- T-SQL differences between SQL Server and Azure SQL Managed Instance
- Resource limits for Azure SQL Managed Instance
- Update policy for Azure SQL Managed Instance
- Overview of SQL Server on Azure Windows Virtual Machines