Rana Maninder Singh
Lesson 3 of 12Cloud Data & AI Engineering

Azure Storage and Data Lake

Lesson opener

In one line: Azure Data Lake Storage is Blob Storage with a hierarchical namespace turned on. Directories become real objects, and you cannot turn that switch back off.

Why it matters: Northline lands a stock extract every night. The first design uses one container named data and file names like stock_final_v3.csv. Analysts cannot tell raw from published. A cleanup deletes a prefix by copying every blob. Figures are illustrative.

Before this lesson: You can place a storage account in a resource group that a sandbox cleanup will not delete.

What you will be able to do

Prerequisites

Lessons 1 and 2. You do not need to create an account to finish the practice.

Blobs, directories, and tiers

Blob Storage stores objects in containers (https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction). Without a hierarchical namespace, a "folder" is only a prefix in the blob name. Renaming a prefix means copying blobs and deleting the sources.

Azure Data Lake Storage is not a separate account type. You unlock it by enabling the hierarchical namespace on a storage account that supports it, such as a standard general-purpose v2 account (https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction). Directories are real. Renaming or deleting a directory is an operation on that directory (https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-namespace). After you enable the hierarchical namespace, you cannot revert the account to a flat namespace. Decide before the production account is full.

Access has two layers when the hierarchical namespace is on (https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-access-control). Azure role-based access control applies at the Azure scope you assign (account, container, and so on). Access control lists apply to directories and files. A person can have a data-plane role and still be limited by an ACL on one directory. This course does not treat a shared account key as the team password. Microsoft documents Microsoft Entra ID and shared access signatures as the preferred authorizations for data access.

Lifecycle management can move blobs between access tiers or delete them on a schedule you write (https://learn.microsoft.com/en-us/azure/storage/blobs/lifecycle-management-overview). A rule is not a backup. Deleting a raw file after seven days is only safe if a later path still holds what the business must keep.

Northline's path convention, which is not an Azure feature:

def lake_path(zone, subject, as_of):
    if zone not in {"raw", "curated", "published"}:
        raise ValueError("unknown zone")
    return f"{zone}/{subject}/{as_of}"

def lifecycle_may_delete(zone, keep_published):
    if zone == "published" and keep_published:
        return False
    return zone == "raw"

assert lake_path("raw", "stock", "2026-09-30") == "raw/stock/2026-09-30"
assert lifecycle_may_delete("raw", True) is True
assert lifecycle_may_delete("published", True) is False

Teacher walkthrough: FX-100 lands once

All figures are illustrative.

  1. The storage account is in rg-nl-analytics with the hierarchical namespace enabled.
  2. The factory writes raw/stock/2026-09-30/stock.csv. The warehouse system remains the system of record.
  3. A check job writes passing rows to curated/stock/2026-09-30/. It does not overwrite raw.
  4. Validation: the raw file's row count matches the extract log. FX-100's units match the warehouse screen for that as_of. The published path is empty until curated passes.

A second workplace case

Retail photos and stock files share one container. A lifecycle rule meant for photos deletes raw/stock because the rule's prefix was raw/. The stock reload has nothing to read. Prefixes are part of the rule. A photo container and a stock filesystem do not share a delete rule.

Failure example: the folder that was only a name

Symptom: Renaming stock_final to stock_2026-09-30 takes hours and the bill spikes. Some tools still see the old files.

Diagnosis: The account has no hierarchical namespace. The "folder" was a name prefix. The tool copied every blob and deleted the originals. The root cause is the account setting, chosen before the data arrived.

Correction: New analytics accounts enable the hierarchical namespace before the first production load. Do not promise a revert. Existing flat accounts need a planned upgrade, not a Friday rename.

Validation: On a test account with the namespace on, renaming a directory is one operation and the file count is unchanged. The production account's property shows the hierarchical namespace enabled before the load.

Guided practice: write the three paths

Scenario: A supplier price file arrives nightly. Finance must keep the published price for the month. Raw files older than 14 days may go. Figures are illustrative. Fourteen days is Northline's choice, not a platform default.

Hints:

Complete solution:

Raw path: raw/price/2026-09-30/prices.csv. Curated path: curated/price/2026-09-30/ after the row count matches the source log and the currency code is present. Published path: published/price/2026-09/ for the month finance reads. A lifecycle rule may expire raw after 14 days. It must not expire published/ while finance still reads that month. The ERP or the pricing system remains the system of record. The lake is a copy with as_of.

Independent practice

Design paths for one file your team receives.

Acceptance criteria:

Common mistakes

  • One container called data for raw and published files.
  • A lifecycle rule with a short prefix that covers more than the zone you meant.
  • Sharing the storage account key in a chat because "RBAC was slow."
  • Believing a directory delete on a flat account is one metadata call.

Quick check

  1. What setting turns on Azure Data Lake Storage capabilities?
  2. Can you turn the hierarchical namespace off after it is on?
  3. What is a folder name on an account without that namespace?
  4. Which zone in Northline's convention may the sample rule delete?
  5. Do ACLs replace Azure role assignments?

Answers:

  1. The hierarchical namespace on the storage account.
  2. No. The documented behavior is that you cannot revert to a flat namespace.
  3. A prefix in the blob name, not a real directory object.
  4. Raw, and only when published data must be kept.
  5. No. Role assignments and ACLs both apply. One does not erase the other.

Quiz alignment

The quiz asks you to enable the namespace on purpose, to keep lifecycle rules off the published zone, and to refuse a shared account key as the team design.

Lesson summary

Blob Storage plus a hierarchical namespace is the lake. Directories are real, and the switch sticks. Split raw, curated, and published. Expire only what you have agreed to lose. Grant directory access without handing out the account key.

Bridge to the next lesson

The next lesson schedules the job that writes raw/stock/. You will name the pipeline, the trigger, and the run you trust.