Chapter 5 of 6 · Implementation

Microsoft Fabric and Microsoft Purview governance for AI data

Optional module · Draft 7 hours

Chapter 5 of 6

Implement#

1. Complete the records#

Fill in every required value under artifacts/. Use the customer-owned private copy for tenant and object IDs. Keep this repository version as the reusable template.

2. Run local preflight#

PowerShell

.\scripts\preflight.ps1 -TargetScope "one-approved-fabric-ai-grounding-lakehouse"

Bash

./scripts/preflight.sh --target-scope "one-approved-fabric-ai-grounding-lakehouse"

Preflight checks the artifact files, target scope, implementation marker, matching Fabric item coordinates, OneLake role member, DLP simulation mode, and the two access checks. It does not sign in or call Fabric.

3. Check tenant-setting drift#

Run the drift check before changing access:

PowerShell

.\scripts\check-tenant-settings.ps1 -TargetScope "one-approved-fabric-ai-grounding-lakehouse"

Bash

./scripts/check-tenant-settings.sh --target-scope "one-approved-fabric-ai-grounding-lakehouse"

The script reads GET https://api.fabric.microsoft.com/v1/admin/tenantsettings, follows paging, and compares the Copilot and AI group to tenant-settings-baseline.json. It reports setting drift without writing the export to the repository.

4. Apply the OneLake role with a dry run first#

Run the Fabric REST dry run from the approved operator shell. Use the artifact's rolePayload as the body and the recorded ETag as If-Match.

PowerShell

$roleRecord = Get-Content .\artifacts\fabric\onelake-ai-consumer-role.json -Raw | ConvertFrom-Json
$fabricToken = az account get-access-token --resource "https://api.fabric.microsoft.com" --query accessToken --output tsv --only-show-errors
$uri = "https://api.fabric.microsoft.com/v1/workspaces/$($roleRecord.fabric.workspaceId)/items/$($roleRecord.fabric.lakehouseItemId)/dataAccessRoles?dryRun=true"
$body = $roleRecord.rolePayload | ConvertTo-Json -Depth 100
Invoke-RestMethod -Method Put -Uri $uri -Headers @{
  Authorization = "Bearer $fabricToken"
  "If-Match" = $roleRecord.fabric.currentDataAccessRoleEtag
} -ContentType "application/json" -Body $body

Bash

role_file="./artifacts/fabric/onelake-ai-consumer-role.json"
workspace_id="$(jq -r '.fabric.workspaceId' "$role_file")"
item_id="$(jq -r '.fabric.lakehouseItemId' "$role_file")"
etag="$(jq -r '.fabric.currentDataAccessRoleEtag' "$role_file")"
fabric_token="$(az account get-access-token --resource "https://api.fabric.microsoft.com" --query accessToken --output tsv --only-show-errors)"
jq '.rolePayload' "$role_file" | curl -fsS -X PUT \
  -H "Authorization: Bearer $fabric_token" \
  -H "If-Match: $etag" \
  -H "Content-Type: application/json" \
  --data-binary @- \
  "https://api.fabric.microsoft.com/v1/workspaces/${workspace_id}/items/${item_id}/dataAccessRoles?dryRun=true"

Review the dry-run response. If it matches the role decision, repeat the same command with dryRun=false or without the query parameter through the approved change path.

5. Apply the label and create the DLP policy#

The Purview operator applies the selected sensitivity label to the lakehouse item through the approved Fabric or Purview path. Then the operator creates a custom Purview DLP policy:

SettingModule value
LocationFabric
ScopeThe approved workspace or item scope in fabric-label-dlp-decision.json
ConditionThe selected sensitivity label
ActionsPolicy tip and alert
StateSimulation mode

Use the Purview policy summary as the change review. Save only when the summary matches fabric-label-dlp-decision.json. Keep the policy in simulation mode after this module.

6. Read the live OneLake role#

PowerShell

.\scripts\verify-access.ps1 -TargetScope "one-approved-fabric-ai-grounding-lakehouse"

Bash

./scripts/verify-access.sh --target-scope "one-approved-fabric-ai-grounding-lakehouse"

The scripts call the read-only OneLake role list endpoint. They confirm the approved AI consumer group is present in AiGroundingConsumerRead, the restricted group is not present, and the DefaultReader review is recorded.

7. Delivery-owner checkpoint#

Before the identity checks, the delivery owner reviews:

  • the tenant-setting drift result;
  • the OneLake dry-run result and applied role;
  • the DefaultReader restricted-principal review;
  • the label and DLP policy summary in simulation mode; and
  • the exact permitted and restricted consumer identities.

Do not continue if any owner cannot explain the restore path.

Optional module

Microsoft Fabric and Microsoft Purview governance for AI data slide deck