🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

Azure Data Compliance: HIPAA, GDPR, SOC 2 Controls

Azure Data EngineeringCompliance⭐ Premium

Compliance becomes tractable the moment it stops being a list of regulations and becomes a list of controls with owners. A framework tells you that protected data must be encrypted and access must be limited; the engineering work is deciding which storage account that applies to, which key it uses, and where the proof lives six months later.

By the end of this lesson you will be able to:

  • Translate a regulatory requirement into an Azure control.
  • Compare HIPAA, GDPR, SOC 2, and FedRAMP in terms of what they demand.
  • Handle access and erasure requests against a real data estate.
  • Produce evidence from logs instead of screenshots.

Prerequisites

  • !Azure RBAC and storage basics
  • !Purview classification fundamentals
  • !Log Analytics query basics

From regulation to control

Regulations describe outcomes, not configurations. HIPAA says protected health information must be safeguarded; GDPR says personal data must be processed lawfully and deleted on request; SOC 2 says controls must operate effectively over a period. None of them names an Azure property, so someone has to build the mapping.

Do that mapping once, in a shared document that lists each obligation, the control that satisfies it, the Azure resource that implements it, the evidence that proves it, and the person who owns it. When the estate changes, the row that goes stale is visible, and the auditor's question becomes a lookup rather than a project.

The four frameworks differ more in scope than in spirit. Most of them converge on the same technical controls: encryption at rest and in transit, least-privilege access, logging with appropriate retention, and incident handling. What changes is who may see the data, how long evidence must be kept, and which contractual or geographic conditions apply.

The four frameworks side by side

FrameworkPrimary scopeDistinctive obligationTypical Azure evidence
HIPAAUS healthcare dataEncryption, access controls, signed BAAsKey Vault config, access logs, agreements
GDPREU personal dataLawful basis, DSAR, erasure, breach noticeClassification, DSAR records, audit trail
SOC 2Service organization controlsControls operating effectively over timeChange history, monitoring, review records
FedRAMPUS federal workloadsBaseline controls and continuous monitoringAssessment reports, POA&M, scan results

Notice that the distinctive obligations sit alongside the common technical core. An estate built with encryption, role-based access, and durable logs is already partway to satisfying all four; the remaining work is procedural, and procedures are where most audit findings originate.

Building the control set in Azure

Express the core controls as configuration so they can be reviewed and redeployed rather than remembered.

{
  "controls": {
    "access_control": {
      "mfa_enforced": true,
      "rbac_least_privilege": true,
      "pim_for_admin_roles": true,
      "conditional_access_location_restricted": true
    },
    "encryption": {
      "at_rest": "AES-256 with customer-managed key",
      "in_transit": "TLS 1.2 minimum",
      "key_rotation": "automatic annually with soft delete"
    },
    "logging": {
      "diagnostic_settings_enabled": true,
      "workspace_retention_days": 90,
      "archive_retention_years": 7
    },
    "data_protection": {
      "soft_delete": true,
      "geo_redundancy": true,
      "classification_enabled": true
    }
  }
}

Two details decide whether this holds up under review. Retention has to be long enough to cover the audit period, which is why 7-year archive storage commonly sits beside a shorter queryable window in Log Analytics. And privileged access needs just-in-time elevation, because standing admin rights are the finding auditors raise most often and fix most easily.

Handling a data subject request

GDPR access and erasure requests are an engineering problem as much as a legal one: you must find every place a given person's data exists, then export or remove it. Purview discovery is the starting point because it knows which assets exist and which contain personal data.

python
from azure.purview.datamap import PurviewDataMapClient
from azure.identity import DefaultAzureCredential

credential = DefaultAzureCredential()
client = PurviewDataMapClient(credential=credential, account_name="purview-prod")


def locate_customer_assets(customer_id):
    hits = client.discovery.search(
        keywords=customer_id,
        filters={
            "and": [
                {"fieldName": "classification", "values": ["PII.Email"]},
            ]
        },
    )
    return list(hits)


def fulfil_erasure(customer_id, assets):
    for asset in assets:
        anonymise_records(asset, customer_id)
    record_request(customer_id, assets, action="erasure")


assets = locate_customer_assets("cust-88421")
print(f"{len(assets)} assets contain the subject's data")

Erasure has exceptions: data covered by a legal hold or required for tax records cannot simply disappear. Express those exceptions in the procedure beforehand, so the response to the request cites a documented basis rather than an ad hoc decision made under time pressure.

Evidence collection that survives an audit

Auditors ask to see a control operating over a period, not a screenshot of a settings blade. That means diagnostic settings on storage, Key Vault, Entra ID, and Purview, routed to a Log Analytics workspace with a retention that matches the control, plus saved queries you can re-run on demand.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.KEYVAULT"
| where OperationName in ("SecretGet", "KeyGet", "KeyWrap", "KeyUnwrap")
| project TimeGenerated, identity_claim_appid_s, resourceId, ResultType
| summarize accesses = count() by identity_claim_appid_s,
    bin(TimeGenerated, 1d)
| order by TimeGenerated desc

Run this on a schedule and export the result into the control record for the period. Pair it with the change history for the configuration itself, because the auditor wants two things: that the control existed and that it was not quietly disabled. Showing both from the same workspace closes the loop.

Owners, cadence, and exceptions

Every control needs a named owner, a review cadence, and a path for exceptions. An exception is not a failure; an undocumented exception is. Record what was approved, by whom, until when, and what compensating control applies in the meantime.

Run a quarterly control review with a small agenda: which controls changed, which exceptions expire, what the last incident taught you, and which evidence was missing when requested. Teams that hold this meeting consistently tend to pass audits with far less scrambling, because the gaps surface in a calm room rather than the week before an assessor arrives.

What Microsoft covers and what stays yours

Shared responsibility is the concept that decides who owns each control, and it is the source of much confusion during audits. Azure is responsible for the physical datacenters, the hypervisor, and the foundational availability of the platform, and it publishes certifications that cover that layer. Everything you configure, networks, keys, identities, retention, and the data itself, remains your responsibility.

In practice that means reading the compliance documentation for the specific service in use rather than assuming the platform's certification flows down automatically. A FedRAMP-authorized service does not make your workload FedRAMP-compliant if the workload allows public access or has no logging. The certification establishes what is possible; your configuration establishes what is true.

The practical checklist is short. Confirm which data classifications you place in the service, verify that encryption and identity controls meet the required baseline, enable the logging the framework demands, and retain the evidence. Document the split in the control register so that when an assessor asks who is responsible for a particular setting, the answer is written down rather than debated.

Common Mistakes

Treating compliance as a one-time certification project

Fix: Operate controls continuously and review them quarterly so evidence accumulates as you work.

Storing evidence in personal drives or screenshots

Fix: Generate evidence from saved Log Analytics queries and attach results to the control record.

Collecting personal data broadly to simplify analytics

Fix: Classify first and minimize collection, because every unnecessary field is a future DSAR and breach liability.

Letting exceptions live in email threads

Fix: Track exceptions with an owner, an expiry date, and a compensating control in the same register.

Best Practices

  • Keep a single register mapping obligations to controls and owners
  • Automate evidence collection on the same schedule as the control
  • Review privileged access and exceptions every quarter
  • Minimize personal data at collection time rather than deleting later
  • Test the DSAR process before a real request arrives

Questions interviewers ask about compliance

đŸŽ¯Interview Tip

Be ready to say which controls are shared across frameworks and which are unique. Emphasizing the common core, encryption, access control, logging, and incident handling, shows that you can implement once and satisfy several obligations at the same time.

Interview Questions

Q1: How would you implement GDPR compliance for a data lake?

Classify personal data with Purview, document a lawful basis, provide a discovery path for access requests, implement erasure or anonymization that reaches archives and copies, apply retention rules, and keep an audit trail of who accessed what.

Q2: What is the difference between encryption at rest and in transit?

At rest the data is encrypted on storage using AES-256, optionally with a customer-managed key. In transit it is protected by TLS on the network. Most frameworks require both, and neither prevents an authorized user from reading data they are permitted to see.

Q3: How do you audit data access for compliance?

Enable diagnostic settings on every service handling regulated data, route them to Log Analytics with an appropriate retention, keep saved queries per control, schedule their execution, and retain the outputs alongside the configuration change history.

Q4: What happens when a control cannot be met on time?

Raise a documented exception with an owner, an expiry date, and a compensating control, then track it in the register until it closes. Undocumented gaps are findings; managed exceptions are accepted risk with an audit trail.

Key Takeaways

  • Map obligations to controls, resources, evidence, and owners once
  • HIPAA, GDPR, SOC 2, and FedRAMP share a common technical core
  • DSAR fulfilment needs discovery, reach into archives, and documented exceptions
  • Evidence should come from scheduled queries with retained outputs
  • Standing privileged access is the most common and most fixable finding
  • Quarterly control reviews keep gaps from becoming audit surprises
🔒

Premium Content

Azure Data Compliance: HIPAA, GDPR, SOC 2 Controls

You've previewed the first section. Unlock this full lesson and 900+ advanced tutorials with a Premium plan.

đŸŽ¯End-to-end Projects
đŸ’ŧInterview Prep
📜Certificates
🤝Community Access

Already a member? Log in

CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-10-12

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Advertisement