# Microsoft Fabric Environment Documentation ## Project Goal Document and analyze Microsoft Fabric environments via the Fabric REST API. ## Authentication - **Tenant ID:** `2bbd7e41-02c9-4b4e-8168-339f900c4319` - **Account:** `matthias.gessenay@corporatesoftware.ch` - **Subscription:** Microsoft Azure Sponsorship ### Getting a fresh token ```bash # Refresh token (writes to .env): bash scripts/refresh-token.sh # Or inline: FABRIC_TOKEN=$(az account get-access-token --resource "https://api.fabric.microsoft.com" --query accessToken -o tsv) ``` ### Using the Fabric API ```bash # Source the helper: source scripts/fabric-api.sh # List workspaces: list_workspaces # List items in a workspace: list_workspace_items # Document a workspace: document_workspace ``` ## Fabric REST API Reference - **Base URL:** `https://api.fabric.microsoft.com/v1` - **Auth Header:** `Authorization: Bearer $FABRIC_TOKEN` ### Key Endpoints | Endpoint | Description | |----------|-------------| | `GET /workspaces` | List all workspaces | | `GET /workspaces/{id}` | Get workspace details | | `GET /workspaces/{id}/items` | List items in a workspace | | `GET /capacities` | List capacities | | `GET /workspaces/{id}/lakehouses/{id}` | Get lakehouse details | | `GET /workspaces/{id}/lakehouses/{id}/tables` | List lakehouse tables | | `GET /workspaces/{id}/semanticmodels/{id}` | Get semantic model details | | `GET /workspaces/{id}/notebooks/{id}` | Get notebook details | | `GET /workspaces/{id}/reports/{id}` | Get report details | ### Item Types Lakehouse, SQLEndpoint, SemanticModel, Report, Notebook, DataPipeline, Dataflow, Warehouse, Environment, SparkJobDefinition, MirroredDatabase, Eventstream, KQLDatabase, KQLQueryset, MLModel, MLExperiment ## Key Workspaces | Workspace | ID | |-----------|-----| | mf-202603-smstack | `feb90cd8-3d10-4429-8a97-fc53b4b47a8b` | ## Conventions - Always refresh token before API calls: `FABRIC_TOKEN=$(az account get-access-token --resource "https://api.fabric.microsoft.com" --query accessToken -o tsv)` - Use `jq` for JSON parsing - Output documentation as Markdown - Never commit `.env` files (contains tokens)