All guides
Practice now
D2 · Data Storage

Data Protection and Encryption

Designing data protection on AZ-305 comes down to three questions: who controls the keys (Microsoft or the customer)? who are we protecting the data from (attackers, administrators, the cloud provider itself)? and how do we guarantee it can't be altered or deleted?

Icon-security-245

Encryption at rest: PMK vs CMK

Platform-Managed Keys (PMK)

  • •Default: EVERYTHING in Azure is encrypted at rest (AES-256) automatically
  • •Microsoft generates, rotates and holds the keys
  • •Zero administration, zero cost
  • •Sufficient unless there is an explicit key-control requirement

Customer-Managed Keys (CMK)

  • •The key lives in YOUR / Managed HSM
  • •You control rotation, revocation and usage auditing
  • •Revoking the key = the data becomes inaccessible (kill switch)
  • •Requires: on the service + wrap/unwrap permissions + soft delete + purge protection on the vault
  • •Exam signal: "the organization must control/be able to revoke the encryption keys"

VM disk encryption

  • • SSE (Server-Side Encryption): default on managed disks; with CMK via a Disk Encryption Set
  • • Encryption at host: also encrypts cache and host↔storage data in transit
  • • Azure Disk Encryption (ADE): BitLocker/dm-crypt INSIDE the OS — when OS-level encryption is required
  • • Confidential disk encryption: for confidential VMs
Icon-databases-130

Encryption in : TDE vs Always Encrypted vs Dynamic Data Masking

TechnologyProtects againstKey feature
TDE (Transparent Data Encryption)Theft of the DB's physical files / backupsEncrypts the entire DB at rest. ON by default. Transparent: SQL admins SEE the data in cleartext when querying. CMK possible (BYOK)
Always EncryptedDB and Azure administrators — data travels encrypted all the way to the clientEncrypts SPECIFIC columns; the client holds the keys. Neither the DBA nor Microsoft see the data. Limits queries (equality with deterministic). With secure enclaves: ranges and LIKE
Dynamic Data MaskingApp users who shouldn't SEE the full valueDoes NOT encrypt — masks the presentation (XXX-XX-1234). Data remains cleartext in the DB. Controls exposure, not cryptographic security
Row-Level SecurityCross-row access between different tenants/usersFilters rows based on the user context — multi-tenant in a single table

The distinction that comes up most

"Neither database administrators nor Microsoft should be able to see the card numbers" → Always Encrypted (TDE won't do — the DBA sees the data). "Encrypt the database and its backups at rest" → TDE. "The call center only sees the last 4 digits" → Dynamic Data Masking.

Encryption in transit and in use

In transit

  • • TLS 1.2+ mandatory: "secure transfer required" property on storage, "HTTPS only" on App Service
  • • SMB 3.x with encryption for Azure Files
  • • VPN/ExpressRoute with MACsec or IPsec for hybrid transit

In use — Confidential Computing

  • • Confidential VMs (AMD SEV-SNP / Intel TDX): encrypted memory — neither the hypervisor nor Microsoft can inspect it
  • • Enclaves (SGX) for code that processes ultra-sensitive data
  • • Signal: "data must be protected even while being processed" → confidential computing
Icon-storage-86

Immutability and delete protection

MechanismWhat it guarantees
Immutable — time-based retentionWORM: no one (not even the Owner) can modify/delete blobs for N days. For SEC/FINRA and ransomware. Locked policy = irreversible
Immutable storage — legal holdWORM with no fixed date — until the hold is lifted (litigation)
Soft delete (blobs, containers, file shares)Recover accidental deletions during the retention period
Blob versioningEvery overwrite creates a recoverable version
Point-in-time restore (block blobs)Restore containers to an earlier point in time
Resource lock CanNotDeleteProtect the ACCOUNT itself against deletion (control plane)

Anti-ransomware signal

"Backups must not be encryptable or deletable by an attacker with administrator credentials" → immutable storage with a locked policy (or Azure Backup vaults with immutability + always-on soft delete + multi-user authorization).

Classification and data governance

  • • Catalog and data map: scans Azure, on-prem and other clouds
  • • Automatic classification of sensitive data (PII, card numbers)
  • • End-to-end data lineage
  • • Signal: "discover and classify sensitive data across the whole estate" → Purview

In SQL

  • • Data Discovery & Classification: sensitivity labels per column
  • • SQL Auditing → Log Analytics/Storage: who queried what
  • • Microsoft for SQL: vulnerability assessment + advanced threat protection
  • • Ledger tables: cryptographic evidence of tamper-freedom

Decision table

RequirementDesign
The organization must be able to revoke the storage encryption keysCMK in Key Vault (+ purge protection)
Neither DBAs nor Microsoft see the card numbersAlways Encrypted on those columns
Encrypt the DB and backups at rest (general compliance)TDE (default; CMK if key control is required)
Support only sees the last 4 digits of the documentDynamic Data Masking
Each tenant only sees their own rowsRow-Level Security
Financial records immutable for 7 years (WORM)Immutable blob storage, time-based locked policy
Data protected even while being processedConfidential VMs / confidential computing
Discover PII across SQL, ADLS and S3Microsoft Purview
Encryption inside the VM's OS (BitLocker)Azure Disk Encryption

Did you get this topic?

Test what you just learned

A fintech stores card numbers in Azure SQL Database. The compliance requirement states: 'card data must not be visible to database administrators or the cloud provider, not even during a query'. TDE is already enabled. What's missing?

Ready to test "Data Protection and Encryption"?

Put what you learned to the test with original AZ-305 exam questions.

Start AZ-305 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.