Claude Code builds the landing and bronze layers in Microsoft Fabric

Claude Code ran its own plan and loaded Azure SQL and a REST API into landing and bronze in Fabric. I only stepped in twice. Estimated cost $1.92.

In this article 8 sections
  1. The plan: landing, bronze, silver, gold, serving
  2. What Claude built before touching the cloud
  3. Where I had to step in
  4. Workspace, lakehouses and workspace identity
  5. The first run fails, and Claude fixes it
  6. The data lands
  7. What the hour cost
  8. Inspecting the bronze lakehouse

Adventure Works is in. Moneybird is in. Both sources land in Microsoft Fabric and load into bronze, the incremental reruns append zero records, and the estimated API cost for about an hour of Claude Code work was $1.92. I didn’t steer it on anything technical.

This is part three of my series on whether AI can replace a Fabric data engineer. In part one I set up a clean macOS virtual machine, and in part two Claude wrote the architecture and the implementation plan. Now Claude starts working through that plan. The only thing I asked was that it leaves me the things it cannot do itself, like fetching a token from Moneybird or setting something up on the Azure SQL side for the Adventure Works database.

Claude Code Built My Fabric Landing and Bronze Layers for $1.92 Watch on YouTube

The plan: landing, bronze, silver, gold, serving

Claude’s plan has a step for every layer. The sources go into the landing lakehouse as raw files and nothing more. From there nb_load_bronze puts them into Delta tables in the bronze lakehouse, with one schema per source and some audit columns added. Silver merges on the business key and takes care of data types, casing and deduplication, then there is an integration step in silver before gold, which is the Kimball (dimensional) model. The serving layer comes last.

Claude's flow table: Azure SQL and the Moneybird REST API as sources, then landing with raw files, bronze in Delta with one schema per source, silver, silver integration, gold as a Kimball star schema and the serving layer
The flow from the plan, from sources to serving

I think landing and bronze are tightly coupled, so I asked Claude to do both in one go: the landing zone with the integration to the two sources, plus the bronze layer.

What Claude built before touching the cloud

Claude first built and tested everything locally. One of the rules in its plan is to ask me before it creates anything in Azure or Fabric, and it stuck to that.

What it came back with:

  • Metadata: metadata/sources/adventureworks.yml covers all 10 SalesLT tables, with column allow-lists that leave out PasswordHash. Moneybird covers contacts, sales invoices, products and tax rates. The JSON Schema is generated from the models.
  • Planner: it builds the Azure SQL extract queries from the allow-list and a watermark.
  • REST extractor: it handles paging, incremental sync, back-off and Retry-After, and lands the raw pages plus a manifest.
  • Bronze loader: it appends only records that differ from the latest bronze row for the same key, and the watermark only moves after the bronze append has committed.
  • Tooling: runtime.py has plan_run, ingest_rest and run_layer to do runs.

47 tests passed and ruff was clean. Claude also broke six of its own safeguards on purpose to check that the tests catch it, and then restored the code. I didn’t ask for that.

Then it listed what it needed from me. First, approval for the cloud steps: resume the tfg01 capacity, create the workspace and lakehouses, deploy the Key Vault with Bicep, create the Azure SQL connection and run the pipelines. Yes. Second, the Moneybird token in Key Vault once the vault exists. Fine, I’ll put it in. Third, a commit decision: it wanted to work on a new branch and open a pull request. There’s only one process writing into this repository, so I’m fine with doing everything in one go.

Where I had to step in

The permission classifier

Claude’s first Azure command got blocked. The permission classifier refused it, and Claude left the decision to me: add a permission rule for az and fab commands against my tenant, or run three commands myself with the ! prefix. I added the permission in the Claude Code settings, and it ran into a block again. That one had to be run in my own terminal, so I opened a new terminal window and ran it there. After that the Key Vault was deployed.

The Moneybird token

With the vault in place I wanted to go YOLO: “I have a token here, KV is deployed, can I just paste it? Everything else, go yolo”. Claude said no. Pasting it puts the token in the conversation history, which breaks its own “no secrets in chat” rule. So I created a new API token in Moneybird and stored it as the moneybird-api-token secret in the Key Vault myself. Claude then checked the secret exists by name, without reading the value, and pointed out it has no expiry date, which is optional but worth setting later.

Workspace, lakehouses and workspace identity

Meanwhile Claude resumed the capacity. I could see it was active in the Azure portal because there was a pause button and no resume button. The workspace, TFG AI Experiment, appeared with the folders from the plan: 00_platform, 10_storage, 20_pipelines, 30_notebooks and 40_serving.

Creating the lakehouses hit two failures first: the Bicep had a wrong Key Vault Secrets User role ID, and a lakehouse without schemas (landing) has to be created with an empty payload. Claude verified the role ID instead of relying on memory and fixed both. After a refresh, 00_platform had lh_control and 10_storage had bronze, gold, landing and silver. Pipelines, notebooks and serving were still empty.

Then it set up a workspace identity that can read the secrets in the vault. Claude came up with that on its own, which is actually pretty cool. (I’ve written about using the workspace identity with Key Vault before.) The identity also has a read-only user on the Adventure Works database, and the Fabric connection uses it.

Next it uploaded everything to lh_control: metadata in Files/metadata/current (the schema plus adventureworks.yml and moneybird.yml under sources), the Python library it wrote in Files/libs, and a config/platform.json with the IDs of the workspace, the lakehouses and the connection. Then it deployed the notebooks: nb_plan, nb_ingest_rest, nb_load_bronze and nb_finalize_sql.

The first run fails, and Claude fixes it

The first run failed with a generic “session statements failed” and a traceback. Claude’s first move was to make the notebooks log every exception, so it could see the real error. In the monitor, nb_ingest_rest had indeed failed: the %pip install of its own package complained it needed a different Python.

Snapshot of the failed nb_ingest_rest run in Fabric, with the error: Package tfg-platform requires a different Python: 3.10.20 not in >=3.11
The first run fails on the Python version

I wasn’t sure it would figure that out on its own, but it did. Fabric’s Python notebooks run 3.10, and the code used datetime.UTC, which needs 3.11. Claude made the package 3.10-compatible, validated the syntax against the 3.10 grammar, ran the tests again (52 passed) and redeployed.

It’s cool how self-sufficient it is. As a data engineer I work with my knowledge and the documentation (and Stack Overflow in the past), build stuff, run into errors, fix them and go back and forth. Claude does the same thing.

The data lands

Moneybird came in first. In lh_landing there’s a folder per entity, with a run_id=R001 folder holding a _manifest.json and the raw pages. Claude counted the bronze rows through the SQL analytics endpoint, and Moneybird bronze matched the test administration exactly. Then it ran the incremental load, expecting no records, and that’s what it got, because nothing happens in this administration.

Adventure Works came in after that. In the monitor I saw the SQL part had run but the bronze load hadn’t started yet, and I thought we were running into concurrency issues, so I told Claude it was allowed to bump the capacity to an F8. It didn’t need to: a full run takes a few minutes on the F2, and it was a bit hesitant to scale up anyway. Fine by me.

Then the summary:

Claude's check table: AdventureWorks bronze equals the source on all 10 tables with 7,822 rows, Moneybird bronze has 843 contacts, 806 invoices, 295 products and 10 tax rates, both second runs appended 0 rows, a wrong administration ID aborted in the guard, and there are no password columns
What Claude checked before calling it done
CheckResult
AdventureWorks bronze vs sourceAll 10 tables equal, 7,822 rows in total
Moneybird bronze vs the test administration843 contacts, 806 invoices, 295 products, 10 tax rates
Second AdventureWorks runAppended 0 rows
Second Moneybird runFetched 0 records for contacts and invoices, appended 0 rows
Wrong administration ID, liveAborted in the guard and landed nothing
Password columnsNone in landing or bronze

The wrong administration ID test is the guard from part two, the one that keeps Claude away from my live Moneybird account. It aborted and landed nothing. That’s cool.

What’s not done yet is Git sync and CI. That’s fine for now. Before I closed the session I asked Claude to write down its memories and findings of the day in a file in the repo, so a future session knows the state.

What the hour cost

I’m on a plan, so there’s no actual API cost I’m billed for. But if we were doing this on the API, /usage estimates the cost at $1.92.

Claude Code /usage screen: estimated cost $1.92, 7m 39s API duration, 38m 42s wall duration, 139 lines added
The estimated API cost for the session
$1.92 for an hour of work is extremely cheap.

Inspecting the bronze lakehouse

By the time I opened Fabric, Claude had already paused the capacity, so I resumed it to have a look. In lh_bronze the dbo schema is empty, the adventureworks schema has a lot of tables (addresses, customers, products, sales orders and so on), and the moneybird schema has contacts, products, sales invoices and tax rates.

Data preview of moneybird.sales_invoices in lh_bronze, with id, version, the record_json column holding the full invoice as JSON, Sys_IsDeleted, Sys_RecordHash and Sys_RunID
Moneybird in bronze: the metadata columns, with the actual data in record_json

Moneybird’s sales invoices show what bronze looks like for the REST source: a few columns of record metadata, and record_json holding the actual data as a JSON string. I was curious what would happen with that, because in silver that record has to be expanded into a proper table. Part four shows what Claude did with it.

Bas Land · Microsoft Data Platform MVP

Bas has spent more than 12 years in the Microsoft data stack. He builds data platforms on Microsoft Fabric, teaches as a Microsoft Certified Trainer and speaks at conferences such as Power BI Gebruikersdagen.

↑↓to move ↵to open escto close