liveBook · Manning

Azure SQL Database

As explained in 100 SQL Server Mistakes and How to Avoid Them

Azure SQL Database is Microsoft's fully managed relational database service hosted on Microsoft Azure.

Azure SQL Database is Microsoft's fully managed relational database service on Azure. As a Database as a Service (DBaaS) option, it lets teams manage databases without managing the underlying operating system, virtual machine, patching, or instance-level infrastructure. section 1.2.2 section 8.6

A common deployment mistake is choosing a SQL Server VM when a managed service better fits the application:

  • A greenfield Azure application with uncertain capacity may not need a self-managed instance. section 8.6
  • Avoiding DBaaS adds patch failures, configuration work, downtime planning, and another instance for an already-stretched DBA team. section 8.6
  • Choose Azure SQL Database when reducing infrastructure administration supports higher-value work such as performance diagnosis and application projects. section 8.6
  • Compare it with Azure SQL Managed Instance when instance management is required, or with a SQL Server VM when full infrastructure control is necessary. section 1.2.2

MagicChoc's cloud-native application

MagicChoc's DBA team recommends an Azure SQL Server VM for a new Azure application, despite limited capacity knowledge and heavy operational pressure. Azure SQL Database would remove instance administration while preserving a familiar Database Engine foundation. section 8.6

Listing 8.5 Creating an autoscaling Azure SQL Database
$sqlAdminName = 'MagicChocAdmin'
$sqlAdminPassword = 'Passw0rd!'

$credentials = $(New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $sqlAdminName, 
$(ConvertTo-SecureString -String $sqlAdminPassword -AsPlainText -Force))

$serverParameters = @{
   ServerName = 'processautomationsql'
   Location = 'eastus2'
   SqlAdministratorCredentials = $credentials
   ResourceGroupName = 'MagicChocApps'
}


New-AzSqlServer @serverParameters


$databaseParameters = @{
   ResourceGroupName = 'MagicChocApps'
   ServerName = 'processautomationsql'
   DatabaseName = 'AutoPro'
   Edition = 'GeneralPurpose'
   ComputeModel = 'Serverless'
   ComputeGeneration = 'Gen5'
   MinimumCapacity = 2
   Vcore = 16
}

New-AzSqlDatabase @databaseParameters

Shows PowerShell provisioning for an autoscaling Azure SQL Database using the General Purpose tier, serverless compute, Gen5 compute generation, and configured capacity limits. section 8.6

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Explains the hosting choice and operational consequences, then demonstrates serverless provisioning without detailing database internals.
Examples
Uses MagicChoc's Azure website and a PowerShell configuration for a serverless General Purpose database.
What it assumes
Assumes familiarity with relational databases and SQL Server while distinguishing managed services from self-managed instances.
What you can do after
Evaluate cloud database hosting choices and configure a serverless Azure SQL Database through PowerShell.
How it connects
Compares DBaaS with SQL Server VMs, Azure SQL Managed Instance, and the SQL Server Database Engine.

Also explained in

Compare how 2 books explain Azure SQL Database →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.