Selecting a relational engine on Azure begins with three questions that shape every later decision: how much SQL Server feature parity does the workload need, how does the workload partition over storage and CPU, and who owns the operating system. Architects who answer those three questions in order avoid the most common AZ-305 trap, which is recommending an engine that technically runs the workload but violates a stated constraint such as VNet isolation, on-premises feature coverage, or storage ceiling. The Azure relational catalogue is structured as a continuum from full IaaS control through fully managed PaaS, and each tier removes one operational burden while restricting one degree of freedom.
Azure SQL Database, the Platform-as-a-Service offering, runs the latest stable SQL Server database engine without exposing the host operating system or the instance surface. Logins, jobs, msdb, CLR with EXTERNAL_ACCESS, cross-database queries against arbitrary databases, and Service Broker between databases are either unsupported or reshaped through elastic queries and Elastic Jobs. The engine ships in three purchase models: DTU for fixed bundles of CPU, memory, and IO that fit predictable small databases; vCore for explicit CPU, memory, and storage selection that scales independently; and serverless for compute that auto-pauses below a configurable delay. Within vCore, the General Purpose tier targets common workloads on premium remote storage, Business Critical pins compute and storage on local NVMe with an Always On replica set, and Hyperscale separates compute from a page-server tier that scales storage to 100 TB and detaches log throughput from the data file.
Azure SQL Managed Instance bridges PaaS and IaaS by exposing the instance scope: SQL Agent jobs, msdb, linked servers to remote SQL Server, Service Broker across databases, cross-database transactions, Database Mail, CLR, and Common Language Runtime EXTERNAL_ACCESS all run inside the instance boundary. The instance lives inside a delegated subnet of an Azure Virtual Network, which gives the architect Network Security Group control, route table integration, and Private Endpoint support without the public IP that single-database Azure SQL exposes by default. The two tiers, General Purpose and Business Critical, mirror the vCore tiers of Azure SQL Database. Storage caps at 16 TB on General Purpose with the new generation hardware and at 5.5 TB on Business Critical, which makes Hyperscale the only PaaS choice above that ceiling. The Next Generation General Purpose tier supports up to 128 vCores.
SQL Server on Azure Virtual Machines is the IaaS path. It is the correct answer only when a stated requirement crosses the PaaS boundary: SQL Server Agent against an instance feature absent in Managed Instance, Distributed Transaction Coordinator across non-SQL endpoints, file-system access for backups or trace, specific build numbers required by an ISV, or operating-system-level tools such as third-party agents. The SQL IaaS Agent extension is a near-mandatory addition because it surfaces automated patching windows, automated backups to Azure Storage, and licence management through the Azure Hybrid Benefit. The architect carries the responsibility for high availability through Always On availability groups, distributed availability groups for cross-region, or failover cluster instances with Azure shared disks.
Recommend a solution for Azure Cosmos DB
When the requirement description includes any combination of multi-region writes, low-single-digit-millisecond latency at scale, schema flexibility across documents, graph traversal, wide-column workloads from existing Cassandra clusters, or a hard SLA that survives a regional outage without architect intervention, the answer pivots to Azure Cosmos DB. The first decision is the API. The NoSQL API is the recommended default for new applications and is the only API that receives features such as analytical store with Azure Synapse Link, hierarchical partition keys, vector search, and full-fidelity change feed at the same time. The MongoDB API targets lift-and-shift from MongoDB drivers up to a documented wire-protocol level. The Cassandra API targets CQL workloads. The Gremlin API exposes a property graph for traversal, the Table API is the migration target for Azure Table Storage, and Azure Cosmos DB for PostgreSQL provides distributed PostgreSQL through the Citus engine for relational shapes that exceed single-node PostgreSQL.
The second decision is the consistency level. Azure Cosmos DB exposes five well-defined levels: Strong, Bounded Staleness, Session, Consistent Prefix, and Eventual. Strong is the only level that guarantees linearizability for single-region writes and forbids multi-region writes. Bounded Staleness bounds the lag by a count of versions or a time interval and is the default recommendation for multi-region read scenarios that need monotonic reads. Session, the default at account creation, gives a single client a read-your-own-writes guarantee through a session token and is sufficient for most user-facing applications. The third decision is the partitioning strategy: the partition key must spread writes evenly, keep transactional workloads inside a single logical partition (each capped at 20 GB of logical data), and support the dominant query filter. Hierarchical partition keys lift the 20 GB ceiling to a tenant level by stacking up to three keys.
# Provision an Azure SQL Database Business Critical with zone redundancy
az sql server create \
--name sqlsrv-finops-prod \
--resource-group rg-data-prod \
--location westeurope \
--enable-ad-only-auth \
--external-admin-principal-type Group \
--external-admin-name "sg-sql-admins-prod" \
--external-admin-sid "00000000-0000-0000-0000-000000000000"
az sql db create \
--name appdb \
--server sqlsrv-finops-prod \
--resource-group rg-data-prod \
--service-objective BC_Gen5_8 \
--zone-redundant true \
--backup-storage-redundancy Zone \
--read-scale Enabled
# Provision an Azure Cosmos DB NoSQL account with Bounded Staleness
from azure.identity import DefaultAzureCredential
from azure.mgmt.cosmosdb import CosmosDBManagementClient
from azure.mgmt.cosmosdb.models import (
DatabaseAccountCreateUpdateParameters, ConsistencyPolicy, Location,
Capability, NetworkAclBypass
)
client = CosmosDBManagementClient(DefaultAzureCredential(), "<sub-id>")
client.database_accounts.begin_create_or_update(
"rg-data-prod", "cosmos-finops-prod",
DatabaseAccountCreateUpdateParameters(
location="westeurope",
kind="GlobalDocumentDB",
consistency_policy=ConsistencyPolicy(
default_consistency_level="BoundedStaleness",
max_staleness_prefix=100000,
max_interval_in_seconds=300,
),
locations=[
Location(location_name="westeurope", failover_priority=0, is_zone_redundant=True),
Location(location_name="northeurope", failover_priority=1, is_zone_redundant=True),
],
enable_multiple_write_locations=False,
capabilities=[Capability(name="EnableServerless")],
public_network_access="Disabled",
network_acl_bypass=NetworkAclBypass.AZURE_SERVICES,
),
).result()
💡 Exam Trap: A stem that says "the workload requires SQL Server Agent jobs and cross-database transactions" rules out Azure SQL Database entirely. Recommend Azure SQL Managed Instance, not SQL Server on Azure Virtual Machines, unless the stem also names an operating-system-level requirement.
💡 Exam Trap: Strong consistency is incompatible with multi-region writes on Azure Cosmos DB. If the stem requires both single-digit-millisecond writes from multiple regions and linearizability, no Azure Cosmos DB configuration satisfies the requirement; the correct answer is a different account topology or a relational engine.
⚠️ Anti-Pattern: Recommending SQL Server on Azure Virtual Machines as the default for migrating an on-premises SQL Server database. The Azure Migrate Database Migration assessment tool maps most legacy databases to Azure SQL Managed Instance with minimal code change. Defaulting to IaaS forfeits automated patching, automated backup, and built-in HA.
📊 Limit: A single logical partition in Azure Cosmos DB holds at most 20 GB of data and supports a maximum of 10,000 request units per second. Hierarchical partition keys lift only the per-tenant data ceiling, not the per-physical-partition throughput.
🎯 Scenario: A retailer migrates a catalogue from on-premises SQL Server 2019 Enterprise to Azure. The catalogue uses cross-database transactions, SQL Agent jobs, and Service Broker between two databases on the same instance. The architect recommends Azure SQL Managed Instance in General Purpose at 16 vCores with zone redundancy enabled, exposes the instance through a Private Endpoint inside the data-tier subnet, and keeps the SQL IaaS migration path as a fallback only for an ISV component requiring Distributed Transaction Coordinator across non-SQL endpoints.
Decision Anchor. Choose Azure SQL Database when the workload is a new application or a database with no instance-level feature dependencies, fits inside the 100 TB Hyperscale ceiling, and benefits from independent compute and storage scaling. Choose Azure SQL Managed Instance when the workload depends on instance-scope features such as SQL Agent across databases, cross-database transactions, linked servers to SQL Server, Service Broker, or CLR with EXTERNAL_ACCESS, and tolerates the 16 TB General Purpose storage ceiling. Choose SQL Server on Azure Virtual Machines when the workload requires operating-system access, a specific SQL Server build number, Distributed Transaction Coordinator across non-SQL endpoints, or features not yet supported by Managed Instance. Choose Azure Cosmos DB when the requirement specifies global distribution with multi-region writes, sub-10-millisecond reads at the 99th percentile, or schema-flexible documents, and pick the API by data model rather than by personal preference.
