Deleting Microsoft Fabric workspaces through the REST API instead of the portal gives teams a repeatable way to clean up many workspaces at once. The article walks through authenticating with Azure CLI, pulling an access token and issuing the DELETE request from PowerShell.
Key points
- A bearer token is obtained with `az account get-access-token` for the `https://api.fabric.microsoft.com` resource.
- `GET /v1/workspaces` returns the id and displayName of every workspace the caller can see.
- Deletion uses `DELETE /v1/workspaces/{workspaceId}` and needs no request body.
- The `Workspace.ReadWrite.All` delegated permission and the Admin workspace role are required.
- Tenants with many workspaces must page results using the continuation token.
- The script asks for a typed DELETE confirmation before it fires the request.
Real-world use
- A scheduled admin script that cleans up temporary demo and test workspaces
- Name-matched bulk removal automation in a tenant with hundreds of workspaces
- Platform teams adding a workspace teardown step to CI/CD or admin workflows
This summary was generated by the agent from the original post on C# Corner. The full text and all rights belong to its author and publisher. Go to original