Azure Documentation

SQL Virtual Machine Configuration

This guide provides detailed information on configuring Azure SQL Virtual Machines to meet performance, security, and compliance requirements.

General
Network
Security

General Settings

SettingDescriptionRecommended Value
SQL Server EditionChoose the appropriate edition based on workload.Enterprise
Max Degree of Parallelism (MAXDOP)Controls parallel query execution.8 (or cores/2)
Memory AllocationConfigure max server memory.70% of VM RAM

Instance Configuration Script

powershell
# Example PowerShell to set max memory
Invoke-Sqlcmd -Query "EXEC sp_configure 'max server memory (MB)', 8192; RECONFIGURE;" -ServerInstance "localhost\SQL2019"
      

Network Settings

SettingDescriptionRecommended Value
Virtual NetworkAttach VM to a dedicated VNet.vnet-sql-prod
SubnetIsolate SQL traffic.subnet-sql-db
NSG RulesAllow inbound 1433/TCP only from application tier.Custom

Security Settings

FeatureDescriptionConfiguration
Transparent Data Encryption (TDE)Encrypt data at rest.Enabled
Always EncryptedEncrypt specific columns.Enabled where needed
Azure Defender for SQLThreat detection.Enabled

Additional Resources