How to check sensitivity labels after moving to Fabric
The short answer
Purview Data Governance is retiring, but sensitivity labels stay in Purview. The Fabric metadata scanner returns each scanned item's label as sensitivityLabel.labelId. Save the scan results and the sensitivity labels from Microsoft Graph, write the label each item should carry in expected.csv, then run a Python and DuckDB script with six checks: items not scanned, missing labels, different labels, unknown labels, turned-off labels and unlabeled items.
Why check every label after the move
Microsoft announced on November 12, 2026 that Purview Data Governance is retiring: “Support for Purview Data Governance will end Nov. 12, 2027” (Microsoft Security blog, read 2026-11-21). Sensitivity labels are not part of what retires: Microsoft's transition guide (read 2026-11-21) keeps classification and sensitive-data protection in Purview, through sensitivity labels and data loss prevention on supported Fabric items, and says to validate item types, inheritance, export behavior and licensing.
Labels do not always follow data into new items. Microsoft's information protection page for Fabric (read 2026-11-21) says labels pass downstream from Power BI item to Power BI item, from Fabric item to Fabric item and from Fabric item to Power BI item, but not from a Power BI item to a Fabric item, and that inheritance from data sources works for Power BI semantic models only. So after data moves into new Fabric items, some items carry the label they should, some carry a different label and some carry no label. Comparing every item with the label the item should carry shows which items carry the wrong label or none.
What you will have at the end
- A label list,
labels-by-item.csv: one row per scanned item, with its workspace, kind, label and the label it should carry. - Six checks, each one PASS or FAIL, with every finding in
findings.csv.
Step 1. Save the scan, the labels and what each item should carry
Fabric's metadata scanner returns the sensitivity label of each item it scans. The scanner starts with POST /v1.0/myorg/admin/workspaces/getInfo, for 1 to 100 workspaces a call, which returns a scan id; once scanStatus/{scanId} reports Succeeded, scanResult/{scanId} returns the scan result, which stays available for 24 hours; each report, dashboard, semantic model, dataflow and datamart in the result carries sensitivityLabel.labelId (PostWorkspaceInfo and GetScanResult references, read 2026-11-21). The label names come from Microsoft Graph's list of sensitivity labels (beta, read 2026-11-21).
We did not run these commands. We have no tenant to run them against, so they are written from Microsoft's references, and the runs further down use generated records in the same shape. Put your workspace ids in WS and sign in with the Azure CLI as a Fabric administrator first.
# Not run by us: written from Microsoft's Power BI admin and Microsoft Graph references (read 2026-11-21).
# Needs the Azure CLI (az login) as a Fabric administrator, and PowerShell 7 with Microsoft Graph PowerShell for the label list (InformationProtectionPolicy.Read).
OUT="fabric-labels-$(date +%Y%m%d-%H%M%S)"; mkdir -p "$OUT/scan"
PBI=$(az account get-access-token --resource https://analysis.windows.net/powerbi/api --query accessToken -o tsv)
API="https://api.powerbi.com/v1.0/myorg/admin/workspaces"
# 1. The workspaces to scan: up to 100 workspace ids per getInfo call.
WS='["<workspace id>", "<workspace id>"]'
SCAN=$(curl -sf -X POST -H "Authorization: Bearer $PBI" -H "Content-Type: application/json" \
"$API/getInfo" -d "{\"workspaces\": $WS}" | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")
# 2. Wait until the scan succeeds, then store its result; Microsoft keeps a scan result for 24 hours.
for TRY in $(seq 1 90); do # at most 15 minutes
ST=$(curl -sf -H "Authorization: Bearer $PBI" "$API/scanStatus/$SCAN" | python3 -c "import json,sys; print(json.load(sys.stdin).get('status'))")
[ "$ST" = "Succeeded" ] && break
[ "$ST" = "Failed" ] && { echo "FAILED: scan $SCAN"; exit 1; }
sleep 10
done
[ "$ST" = "Succeeded" ] || { echo "FAILED: scan $SCAN did not finish"; exit 1; }
curl -sf -H "Authorization: Bearer $PBI" "$API/scanResult/$SCAN" -o "$OUT/scan/scan-1.json"
# 3. The sensitivity labels available to you, from Microsoft Graph (beta). The Azure CLI's Graph token does not carry
# InformationProtectionPolicy.Read, so this step signs in with Microsoft Graph PowerShell (module Microsoft.Graph.Authentication).
pwsh -Command "Connect-MgGraph -Scopes InformationProtectionPolicy.Read -NoWelcome; Invoke-MgGraphRequest -Method GET -Uri 'https://graph.microsoft.com/beta/me/security/informationProtection/sensitivityLabels' -OutputFilePath '$OUT/labels.json'" || { echo "FAILED: label list"; exit 1; }
echo "Saved to $OUT. Now write $OUT/expected.csv: item_id, expected_label."
Then write expected.csv in the same folder, with the columns item_id and expected_label (a label id, a label name, or Parent\Label for a sublabel whose name another label shares): the label each item should carry, taken from the label the data carried before the move.
Step 2. Check the labels
Download check_fabric_labels.py, install DuckDB (pip install duckdb) and run the script on the folder the commands wrote:
python3 check_fabric_labels.py fabric-labels-20261121-093000
| Check | What a failure means |
|---|---|
| Every item in expected.csv is in the scan results | The item was not scanned, was renamed to a new id, or was never moved. |
| Every item that should carry a label carries one | The label did not follow the data into the item. |
| Every item carries the label expected.csv names | The item carries another label, for example a label inherited from a different source. |
| Every label on an item is in labels.json | The label was deleted, the label is not published to the person who saved labels.json, or the label list was saved from another tenant. |
| No item carries a label the tenant has turned off | The item still carries a label the tenant has turned off; choose a label that is turned on. |
| Every scanned item carries a label | An item outside expected.csv has no label at all; decide whether the item needs a label. |
Run 1. Generated scan results, clean
The script writes generated inputs when you ask for them: four workspaces with 13 items in two scan results, four labels from Public to Highly Confidential, and the label each item should carry, with a fixed seed.
python3 check_fabric_labels.py --make-demo demo
Wrote generated inputs to demo: 4 workspaces with 13 items in 2 scan results, 4 labels, 13 expected labels (seed 272)
python3 check_fabric_labels.py demo
Python 3.14.8 duckdb 1.5.6 Input: demo Read 2 scan result files: 4 workspaces, 13 items; 4 labels; 13 expected labels Items by kind and label dashboards Highly Confidential 1 dataflows Confidential 1 dataflows Highly Confidential 1 datamarts Confidential 1 datasets Confidential 1 datasets General 1 datasets Highly Confidential 1 datasets Public 1 reports Confidential 1 reports General 2 reports Highly Confidential 1 reports Public 1 Checks PASS Every item in expected.csv is in the scan results PASS Every item that should carry a label carries one PASS Every item carries the label expected.csv names PASS Every label on an item is in labels.json PASS No item carries a label the tenant has turned off PASS Every scanned item carries a label Wrote labels-by-item.csv (13 items) and findings.csv (0 rows) to . RESULT: 0 findings. Every item carries the label it should.
How to read it
The table counts items by kind and label. All six checks pass: every item carries the label expected.csv names, and no item is left without one.
Run 2. The same workspaces with six planted problems
python3 check_fabric_labels.py --make-demo demo-planted --plant-errors
Wrote generated inputs to demo-planted: 4 workspaces with 14 items in 2 scan results, 5 labels, 12 expected labels (seed 272) Planted one problem for each check: DIFFERENT_LABEL, INACTIVE_LABEL, NOT_SCANNED, NO_LABEL, UNKNOWN_LABEL, UNLABELED_ITEM
python3 check_fabric_labels.py demo-planted --tag planted
Python 3.14.8 duckdb 1.5.6 Input: demo-planted Read 2 scan result files: 4 workspaces, 14 items; 5 labels; 12 expected labels Items by kind and label dashboards Highly Confidential 1 dataflows (no label) 1 dataflows Highly Confidential 1 datamarts Confidential 1 datasets Confidential 1 datasets General 1 datasets Highly Confidential 1 datasets Public 1 reports (no label) 1 reports 80b1bb3a-7297-481c-863b-ff6a9e 1 reports Confidential 1 reports General 2 reports Internal (turned off) 1 Checks FAIL Every item in expected.csv is in the scan results (1) FAIL Every item that should carry a label carries one (1) FAIL Every item carries the label expected.csv names (1) FAIL Every label on an item is in labels.json (1) FAIL No item carries a label the tenant has turned off (1) FAIL Every scanned item carries a label (1) NOT_SCANNED item 8dd8c5ef-1e76-41d8-8db8-a930b50c0161: expected Confidential, but the item is in no scan result NO_LABEL dataflows Ledger dataflow: no label; expected Confidential DIFFERENT_LABEL reports Headcount report: carries General; expected Highly Confidential UNKNOWN_LABEL reports Territory report: label 80b1bb3a-7297-481c-863b-ff6a9ee6e0f3 is not in labels.json INACTIVE_LABEL reports Holiday calendar: label Internal (turned off) is turned off (isActive false) UNLABELED_ITEM reports Ad hoc export: in workspace Sales, no label and not in expected.csv Wrote labels-by-item-planted.csv (14 items) and findings-planted.csv (6 rows) to . RESULT: 6 findings. Fix the labels in Fabric, scan again and re-run.
| Check | The problem planted in run 2 |
|---|---|
| Not scanned | An expected item that is in no scan result. |
| No label | The Ledger dataflow with its label removed. |
| Different label | The Headcount report labeled General instead of Highly Confidential. |
| Unknown label | The Territory report carrying a label id that is not in labels.json. |
| Turned-off label | The Holiday calendar carrying a label the tenant has turned off. |
| Unlabeled item | An Ad hoc export report with no label, outside expected.csv. |
Check the labels in your own tenant
Run the commands in step 1 with WS set to your workspace ids. The commands write a folder named fabric-labels- followed by the date and time, for example fabric-labels-20261121-093000, holding a scan folder with the scan result in scan-1.json, and the sensitivity labels in labels.json. Each getInfo call takes up to 100 workspaces; for more workspaces, scan each batch and save each scan result in the same scan folder as scan-2.json, scan-3.json and so on. Then add expected.csv to the same folder, with the columns item_id and expected_label: one row for each item, naming the label the item should carry by id or by name. Then run python3 check_fabric_labels.py followed by the folder's name. A line that starts with CANNOT READ THE INPUT names what is missing or in the wrong shape. The script writes labels-by-item.csv and findings.csv to the script's own folder; add --out followed by a folder name to write the two files somewhere else. You do not edit the script.
We also tested a run on a second set of generated inputs, saved the way you would save your own: two scan results for two batches of workspaces, upper-case ids, expected labels given by name and by id, a label with a parent label, and one planted problem for each check. All six checks failed as planted, and nothing else was flagged.
Download check_fabric_labels.py · Get the full guide (PDF)
Result from run 1: labels-by-item.csv.
Get the full guide as a PDF
We'll email you a link to it. Please use your work email.
Thanks, . We're sending the link to now. If it isn't there in a few minutes, check your spam or junk folder, or email info@datameaning.com.
Limits
- The runs on this page use generated records, not a tenant, and the commands in step 1 were not run. The field names come from Microsoft's references, read on 2026-11-21.
- Microsoft's GetScanResult reference shows the label on reports, dashboards, semantic models, dataflows and datamarts. The script reads any item with an id in the scan result, but an item type the scanner does not return is not checked.
- The expected label for each item is yours to set. The script compares labels; the script does not decide which label an item should carry.
- The script reports a different label without calling the label higher or lower; Microsoft Graph's
sensitivityvalue (lower is less sensitive) could rank labels, and the script does not use the value. - The commands list the labels available to the signed-in user. A label not published to that user is reported as unknown, so save the list as a user who sees every label, or as an app with InformationProtectionPolicy.Read.All from
/security/informationProtection/sensitivityLabels, which returns the labels available to the organization. - The turned-off check reads
isActive, the field the list call returns; Microsoft's sensitivityLabel resource also hasisEnabled, which the script does not read. - The labels come from the Microsoft Graph beta endpoint, which can change.
- Dates are as of 2026-11-21. This guide is about Purview Data Governance, whose support ends on November 12, 2027.
Tested on
Tested on
- Platform
- DuckDB 1.5.6, run from Python 3.14.8
- Edition
- Open-source DuckDB library (
pip install duckdb) - Date
- 2026-11-21
- Records
- Generated: four invented workspaces with 13 items and four labels, fixed seed 272, in the shape of the scanner's GetScanResult answer and Microsoft Graph's label list. Not a run against a tenant.
- Code
- check_fabric_labels.py
- Results
- labels-by-item.csv
When this is not enough
The check shows which items carry the wrong label or none. Fixing the labels, and the data loss prevention policies that rely on them, is the next step, item by item, before support for Purview Data Governance ends on November 12, 2027.
Moving your whole Purview governance catalog, not only checking the labels?
Purview to OneLake Migration is in early access. The offering starts with the four-day Catalog Transition Assessment: one fixed fee of $12,000, and no commitment to anything else. You get an inventory of every object in your Purview governance catalog and a decision for each object. AI does the first pass, and your stewards sign every domain.