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
| Setting | Description | Recommended Value |
|---|---|---|
| SQL Server Edition | Choose the appropriate edition based on workload. | Enterprise |
| Max Degree of Parallelism (MAXDOP) | Controls parallel query execution. | 8 (or cores/2) |
| Memory Allocation | Configure 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
| Setting | Description | Recommended Value |
|---|---|---|
| Virtual Network | Attach VM to a dedicated VNet. | vnet-sql-prod |
| Subnet | Isolate SQL traffic. | subnet-sql-db |
| NSG Rules | Allow inbound 1433/TCP only from application tier. | Custom |
Security Settings
| Feature | Description | Configuration |
|---|---|---|
| Transparent Data Encryption (TDE) | Encrypt data at rest. | Enabled |
| Always Encrypted | Encrypt specific columns. | Enabled where needed |
| Azure Defender for SQL | Threat detection. | Enabled |