Azure SQL: Technical Handbook/Ch 1. Introduction to Azure SQL Services

Chapter 1

Introduction to Azure SQL Services

15 min read

0:01
1x

Chapter Summary

# Chapter 1: Introduction to Azure SQL Services Welcome to the world of Azure SQL. If you are reading this, you likely already understand the basics of relational databases. You know what a table is, you’ve written a `SELECT` statement, and you understand the importance of primary keys. Now, we are...

Chapter 1: Introduction to Azure SQL Services

Welcome to the world of Azure SQL. If you are reading this, you likely already understand the basics of relational databases. You know what a table is, you’ve written a

text
SELECT
statement, and you understand the importance of primary keys. Now, we are moving from the world of managing "servers" to the world of "managed services."

In this chapter, we will demystify the Azure SQL landscape, help you choose the right deployment model, and prepare you for a cloud-first data architecture.


The Shift: From On-Premises to Azure SQL

In a traditional on-premises environment, your team is responsible for everything: hardware procurement, OS patching, SQL Server installation, backup configuration, and physical security. When you move to Azure SQL, the "Responsibility Matrix" shifts heavily toward Microsoft.

Azure SQL is the collective name for a family of SQL Server-based database services that run in the Azure cloud. It isn't just one product; it’s a spectrum of options designed to meet different operational needs.

"The true power of Azure SQL isn’t just about moving your database to a data center; it’s about decoupling your data management from the underlying infrastructure so you can focus on building applications, not managing Windows Server updates."


The Three Pillars of Azure SQL

To succeed in this role, you must understand the three primary deployment options. Choosing the wrong one can lead to unnecessary costs or feature limitations.

1. Azure SQL Database

This is a Platform as a Service (PaaS) offering. It is a fully managed database engine. You don't manage the underlying OS or the SQL Server version; Microsoft handles the patching, backups, and high availability automatically.

  • Best for: Modern cloud applications, microservices, and developers who want to avoid administrative overhead.

2. Azure SQL Managed Instance

This is also a PaaS offering, but it is designed to be near-100% compatible with an on-premises SQL Server instance. It supports features that standard Azure SQL Databases don't, like cross-database queries, SQL Agent jobs, and linked servers.

  • Best for: "Lift and shift" migrations where existing applications rely on specific SQL Server features that aren't available in standard Azure SQL Database.

3. SQL Server on Azure Virtual Machines

This is Infrastructure as a Service (IaaS). You get a virtual machine with a full version of SQL Server installed. You have full administrative control—you can install third-party drivers, tweak OS-level settings, and manage your own backups.

  • Best for: Legacy applications that require deep OS-level access or specific SQL Server versions that aren't supported by the managed services.

Real-World Example: Choosing Your Path

Imagine you are working for GlobalRetail Corp. You have three distinct projects:

  1. A new mobile app: You are building a greenfield (new) app to track loyalty points. You want it to scale automatically as users join. Choice: Azure SQL Database. It’s serverless, cost-effective, and scales based on app traffic.
  2. An aging ERP system: You have a 10-year-old accounting platform that uses SQL Agent jobs for nightly reports and requires cross-database queries. Choice: Azure SQL Managed Instance. It provides the SQL Server feature parity needed without the pain of managing the underlying OS.
  3. A highly specialized banking engine: Your team needs to install a specific legacy OLEDB driver on the OS to communicate with a mainframe. Choice: SQL Server on Azure VM. You need the granular OS access that only IaaS can provide.

Getting Started: Basic T-SQL in Azure

Once your resource is provisioned, you connect to it just like any other SQL Server. You can use SQL Server Management Studio (SSMS), Azure Data Studio, or even the command line.

Here is a quick look at how you might check your database edition once connected:

sql
-- Checking the version and edition of your Azure SQL resource
SELECT 
    SERVERPROPERTY('MachineName') AS [MachineName],
    SERVERPROPERTY('Edition') AS [Edition],
    SERVERPROPERTY('ProductVersion') AS [ProductVersion],
    DB_NAME() AS [CurrentDatabase];

Practical Tip: Always use Azure Data Studio for your day-to-day work if you are a developer. It is lightweight, cross-platform, and integrates perfectly with Git for version control of your T-SQL scripts.


Key Best Practices for Azure SQL

When starting out, it is easy to over-provision or overlook security. Keep these best practices in mind:

  1. Identity Over Secrets: Never embed connection strings with hardcoded passwords in your code. Use Azure Managed Identities. This allows your application to authenticate to the database using its Azure AD identity, removing the need for password rotation entirely.
  2. Right-Sizing: Azure SQL uses the "vCore" or "DTU" model. Don’t start with the biggest instance. Start small and use the Azure Monitor metrics to see if your database is actually utilizing those resources.
  3. Enable Auditing: Always turn on Azure SQL Auditing. It is a one-click setting in the portal that logs database events to a storage account. It’s a lifesaver for compliance and troubleshooting accidental data deletion.

Configuring Auditing (Example)

You can configure auditing via T-SQL as well:

sql
-- Example of enabling a database audit specification
CREATE DATABASE AUDIT SPECIFICATION [MyAuditSpecification]
FOR SERVER AUDIT [MyServerAudit]
ADD (SELECT, INSERT, UPDATE, DELETE ON SCHEMA::dbo BY public)
WITH (STATE = ON);

The "Serverless" Advantage

One of the most exciting features of Azure SQL Database is the Serverless compute tier. Unlike a standard "Provisioned" database that charges you for the CPU 24/7, a Serverless database will automatically pause when there is no activity (saving you money) and resume the moment a query hits the database.

When to use Serverless:

  • Dev/Test environments where you don't need the database at night or on weekends.
  • Internal tools used only during business hours.
  • Low-traffic applications where query patterns are intermittent.

Chapter Summary & Looking Ahead

In this chapter, we explored the foundational aspects of Azure SQL. We categorized the three deployment models (SQL Database, Managed Instance, and VM), discussed how to match the service to your business needs, and touched upon modern security practices like Managed Identities.

Checklist for your first deployment:

  • [ ] Determine if you need PaaS (managed) or IaaS (VM).
  • [ ] Choose the appropriate Service Tier (General Purpose vs. Business Critical).
  • [ ] Set up Azure AD Authentication.
  • [ ] Enable Auditing.

In the next chapter, we will dive deep into Provisioning and Networking, where we will look at how to secure your database using Virtual Networks and Private Endpoints to ensure your data is never exposed to the public internet.


Ready to deploy your first instance? Log into your Azure Portal and navigate to "SQL Databases" to get started.

What You Learned

  • 1

    Azure SQL transitions database management from physical on-premises infrastructure to a cloud-based service model managed by Microsoft.

  • 2

    The primary goal of adopting Azure SQL is to decouple data management from hardware administration to prioritize application development over server maintenance.

  • 3

    Understanding the distinct deployment models within the Azure SQL family is essential for selecting the architecture that best aligns with specific operational requirements.

📖 Key Terms

PaaS (Platform as a Service)

A cloud computing model where the service provider manages the underlying infrastructure, OS, and software updates, allowing users to focus solely on managing their data.

IaaS (Infrastructure as a Service)

A cloud computing model where the provider hosts the hardware and virtualization, but the customer retains full control over the operating system, middleware, and applications.

Elastic Pool

A shared resource container in Azure SQL Database that allows multiple databases to share a specific amount of compute and storage, optimizing cost for variable workloads.

Lift and Shift

The process of migrating an application and its associated data from an on-premises environment to the cloud with minimal architectural changes.

Surface Area Compatibility

The degree to which an Azure SQL service supports the features, stored procedures, and configurations available in a standard on-premises Microsoft SQL Server instance.

Quiz requires login

Sign in to take the quiz and track your progress.