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

Azure Data Governance: Labels, RBAC, Retention

Azure Data EngineeringData Governance⭐ Premium

Data governance has a reputation for being policy work that engineers avoid. In practice it is a set of concrete technical decisions: who may read a given path, how a file becomes classified as confidential, how long a dataset is kept, and what evidence remains afterwards. Each of those decisions maps to a specific Azure control, and this lesson walks through them in the order you would actually implement them.

You will be able to:

  • Convert raw classification results into sensitivity labels with real consequences.
  • Choose between RBAC and data lake ACLs without creating accidental holes.
  • Write retention rules that tier storage and still satisfy a retention schedule.
  • Produce audit evidence from logs instead of screenshots.

Prerequisites

  • !Azure RBAC and resource scoping
  • !ADLS Gen2 hierarchy and POSIX ACLs
  • !Azure Monitor diagnostic settings

Governance is a decision system, not a document

A governance programme fails when it stops at definitions. Teams publish a standard that says customer data must be protected, then leave the mapping from that phrase to an actual storage path undefined. Six months later two engineers make opposite choices: one encrypts with a customer-managed key, the other relies on platform defaults, and nobody can say which is correct.

The working version of governance has four moving parts. Classification decides what a piece of data is. Policy decides what must be true for that classification. Enforcement makes the policy automatic rather than advisory. Evidence proves, after the fact, that enforcement ran. Remove any one of them and the programme degrades: classification without enforcement is a spreadsheet, and enforcement without evidence cannot be audited.

Treat each part as an artifact in source control where possible. Classifiers and label definitions belong in a deployment pipeline, retention rules belong in Bicep, and audit queries belong in a repository next to the queries that operate the platform. Governance that ships through the same pipeline as infrastructure does not rot quietly.

Sensitivity labels from classification to enforcement

Microsoft Purview classification tells you that a column looks like an email address. A sensitivity label turns that finding into a consequence: encryption, access conditions, or a watermark that follows the document. The sequence is deliberately two-stage, because auto-labelling every matching file on day one usually disrupts more work than it protects.

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

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

client.classification.add_classification(
    entity_type="azure_datalake_gen2_path",
    entity_guid="asset-guid",
    classifications=[
        {"typeName": "Microsoft.SensitivityLabel.Confidential"},
        {"typeName": "PII.Email"},
    ],
)

details = client.classification.get_classification(
    entity_type="azure_datalake_gen2_path",
    entity_guid="asset-guid",
)
print([c["typeName"] for c in details])

Roll labels out in waves. Start with a label that has no enforcement and observe what it would have tagged. Promote it to encryption and access conditions only after stewards confirm that the classifier's precision is acceptable. The blast radius of a wrong label is an outage for the people who need the data; the blast radius of a wrong observation is a review meeting.

RBAC, ACLs, and where each one stops

Azure gives you two overlapping permission systems over the same storage account, and confusing them is the most common governance defect in data lake environments.

ControlScopeAssign toStrengthLimitation
Role assignment (RBAC)Account, container, queueGroups and service principalsCentral, easy to auditStops at the resource boundary
POSIX ACLDirectory and fileUsers and groupsFine-grained inside the lakePer-path upkeep becomes unwieldy
Conditional accessIdentitySign-in contextEnforces MFA and locationDoes not evaluate data content
Sensitivity labelContentThe data itselfTravels with the fileNeeds a supporting access rule

Use RBAC to grant an engineering group Storage Blob Data Contributor on the account, then reach for ACLs only when a single directory inside a container genuinely needs different treatment, such as a restricted hr/ folder. Assigning both at scale leads to denials that nobody can explain, because the effective permission is the union of two systems a reviewer must reconcile by hand.

Retention and lifecycle rules that survive an audit

Retention is where governance meets money. Data kept forever costs storage, slows discovery, and increases exposure; data deleted early breaks a regulatory schedule. The answer is a tiered policy that moves cold data to cheaper redundancy and removes it only when a schedule explicitly allows it.

resource lifecycle 'Microsoft.Storage/storageAccounts/managementPolicies@2023-01-01' = {
  parent: storageAccount
  name: 'default'
  properties: {
    rules: [
      {
        name: 'archive-cold-financials'
        enabled: true
        type: 'Lifecycle'
        definition: {
          actions: {
            baseBlob: {
              tierToCool: { daysAfterModificationGreaterThan: 30 }
              tierToArchive: { daysAfterModificationGreaterThan: 90 }
              delete: { daysAfterModificationGreaterThan: 2555 }
            }
          }
          filters: {
            prefixMatch: ['finance/']
            blobTypes: ['blockBlob']
          }
        }
      }
    ]
  }
}

Two thousand five hundred and fifty days is seven years, a common financial retention floor. Pair the delete action with a legal hold capability so a litigation hold can suspend deletion. Also remember that deleting a blob does not delete its metadata, backups, or downstream copies, so the retention schedule has to name every copy it applies to.

Audit evidence you can hand over

Auditors rarely ask whether a control exists; they ask to see it operating over a period. That means enabling diagnostic settings on storage, Key Vault, Purview, and Entra ID, routing them to a Log Analytics workspace, and keeping them for the retention period the control requires.

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STORAGE"
| where Category == "StorageRead"
| extend caller = coalesce(identity_claim_appid_s, caller_ip_s)
| summarize accesses = count(), firstSeen = min(TimeGenerated),
    lastSeen = max(TimeGenerated) by caller, resourceId
| where accesses > 0
| order by accesses desc

Schedule this query, save the output with a timestamp, and attach it to the quarterly control review. The same workspace becomes the source for alerts on unusual access patterns, which converts governance from a retrospective exercise into something that can catch a problem while it is happening.

A rollout that does not stall in quarter one

Big-bang governance programmes stall because they ask every team to change behaviour before anything visible improves. Sequence the work instead. In the first quarter, classify and assign owners to the two or three domains with the highest regulatory exposure, and enable logging everywhere so evidence starts accumulating even before enforcement begins.

The second quarter adds labels in observe mode on those same domains, plus a first retention policy on a low-risk path where a mistake is cheap to reverse. Use the observed label results to tune classifiers, and publish what was found, because discovering previously unknown personal data is itself a result leadership cares about.

In the third quarter, enforce the labels that earned trust, move the glossary into quarterly review, and start reconciling RBAC assignments against the ownership list. By the fourth quarter the programme has measurable outputs: percentage of critical assets with owners and labels, number of retention rules under version control, and audit queries that run on schedule without anyone remembering to trigger them.

At that point governance stops being a project with an end date and becomes part of how the platform ships changes, which is the only version of it that keeps working after the initial enthusiasm fades.

Common Mistakes

Enforcing labels automatically on day one

Fix: Run labels in observe mode first, review precision with stewards, then enable enforcement in waves.

Applying RBAC and ACLs to the same paths without a rule

Fix: Default to RBAC and reserve ACLs for directories with genuinely different access needs.

Writing a retention policy that ignores copies and backups

Fix: Enumerate every copy of the dataset, including downstream exports, and schedule each one explicitly.

Collecting logs without a retention plan

Fix: Set diagnostic settings with an explicit lifetime that matches the control, then verify with a saved query.

Best Practices

  • Keep classifier, label, and retention definitions in source control
  • Assign a named data owner to every domain in the catalog
  • Reconcile RBAC and ACL assignments on a fixed cadence
  • Produce audit evidence from scheduled queries, not screenshots
  • Separate observe mode from enforce mode when introducing new policies

Questions interviewers ask about governance

đŸŽ¯Interview Tip

Governance questions are usually probing whether you understand trade-offs. Answer with the mechanism and its cost: labels protect content but do not by themselves deny access, ACLs give granularity but scale poorly, and geo-redundancy improves durability while doubling storage charges.

Interview Questions

Q1: How do you implement data governance across a data lake?

Classify with Purview, assign domain ownership, apply sensitivity labels, grant access through RBAC with ACL exceptions, publish a glossary, set retention rules, and retain diagnostic logs as evidence. Each step produces an artifact you can show an auditor.

Q2: When would you use an ACL instead of a role assignment?

When a specific directory inside a shared container must be restricted independently of everyone else using the storage account. If the requirement applies to the whole account or container, a role assignment is simpler and easier to audit.

Q3: How does retention interact with GDPR requests?

Retention defines the minimum time data must be kept, while erasure requests remove personal data earlier when there is no overriding legal basis to keep it. The policy has to express both directions, and the deletion path must reach archives and copies as well.

Q4: What does good governance evidence look like?

Time-stamped query results from a Log Analytics workspace showing the control operating over a period, plus the version-controlled configuration that defines the control, plus the change history showing who approved modifications.

Key Takeaways

  • Governance needs classification, policy, enforcement, and evidence together
  • Roll sensitivity labels out in observe mode before enforcing them
  • RBAC for the resource boundary, ACLs for rare per-directory exceptions
  • Retention must cover copies, archives, and backups, not just the primary path
  • Audit evidence should be generated by saved queries on a schedule
  • Definitions belong in source control so changes are reviewable
🔒

Premium Content

Azure Data Governance: Labels, RBAC, Retention

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