Automate Microsoft Fabric and Power BI administration from PowerShell.
π Documentation Β· π Quick start Β· π Changelog Β· π Cmdlet maturity
FabricTools gives you more than 200 cmdlets to manage Microsoft Fabric from a script or a pipeline: workspaces, capacities, items such as lakehouses, warehouses, notebooks and data pipelines, Git integration, deployment pipelines, connections, schedules and tenant settings. It works with Windows PowerShell 5.1 and PowerShell 7 on Windows and Linux.
Note
FabricTools is in public preview. Cmdlets are still changing between releases, and not all of them are equally mature. Check the cmdlet maturity report to see how well each cmdlet is tested before you rely on it in production.
# Install from the PowerShell Gallery
Install-Module FabricTools -Scope CurrentUser
# Sign in (opens the interactive account picker)
Connect-FabricAccount -TenantId '<tenant-id>'
# Explore
$workspace = Get-FabricWorkspace -WorkspaceName 'Sales'
Get-FabricLakehouse -WorkspaceId $workspace.idThe access token is checked before every call and, by default, renewed automatically when it expires, so long-running scripts keep working.
Each area links to its cmdlets on the documentation website, where you can search every cmdlet and see its syntax, parameters and examples.
| Area | Examples |
|---|---|
| Workspaces | Create and update workspaces, manage role assignments, assign capacities |
| Capacities | List capacities and SKUs, suspend and resume, check workloads |
| Items | Lakehouses, warehouses, notebooks, data pipelines, semantic models, reports, KQL databases, eventhouses, eventstreams, environments, Spark job definitions, ML models and more |
| Git integration | Connect a workspace to Git, check status, commit and update |
| Deployment pipelines | Create pipelines, assign stages and deploy content |
| Domains and tenant | Organise workspaces into domains, read and override tenant settings |
| Core | Sign-in, connections, and Invoke-FabricRestMethod for any Fabric API not yet covered by a cmdlet |
Connect-FabricAccount supports interactive sign-in, device code and service principals.
# Interactive user sign-in
Connect-FabricAccount -TenantId '<tenant-id>'
# Device code, for terminals that cannot show the account picker
Connect-FabricAccount -UseDeviceAuthentication
# Service principal: the username is the application (client) ID, the password is the client secret
$credential = Get-Credential -UserName '<app-id>' -Message 'Client secret'
Connect-FabricAccount -TenantId '<tenant-id>' -Credential $credential$capacity = @{
SubscriptionID = '<subscription-id>'
ResourceGroup = 'rg-fabric'
Capacity = 'fabriccapacity01'
}
Suspend-FabricCapacity @capacity
Resume-FabricCapacity @capacity$run = @{
WorkspaceId = $workspace.id
DataPipelineName = 'Daily load'
Parameters = @{ loadDate = (Get-Date -Format 'yyyy-MM-dd') }
}
Start-FabricDataPipeline @runGet-FabricGitStatus -WorkspaceId $workspace.id -ChangesOnly
Invoke-FabricGitCommit -WorkspaceId $workspace.id -Comment 'Nightly sync'$capacity = Get-FabricCapacity -CapacityName 'fabriccapacity01'
Get-FabricWorkspace |
Where-Object displayName -like 'Sales*' |
ForEach-Object { Add-FabricWorkspaceCapacity -WorkspaceId $_.id -CapacityId $capacity.id }Invoke-FabricRestMethod -Uri 'workspaces' -Method Get- Windows PowerShell 5.1 or PowerShell 7+, on Windows or Linux
- A Microsoft Fabric or Power BI tenant, and permissions for the objects you manage
- An Azure subscription, only for the capacity cmdlets that use Azure Resource Manager (for example
Suspend-FabricCapacity) - The modules Az.Accounts, Az.Resources and PSFramework, which are installed automatically by
Install-Module FabricTools
Contributions are welcome. Pull requests target the develop branch.
git clone https://github.com/dataplat/FabricTools.git
cd FabricTools
./build.ps1 -ResolveDependency -Tasks noop # first time only
./build.ps1 -Tasks build, testSee CONTRIBUTING.md for the development workflow and conventions, and the Code of Conduct for how we work together.
In alphabetical order:
- Tiago Balabuch (tiagobalabuch): wrote most of the cmdlets and made the module robust and well organised
- Ioana Bouariu (Jojobit): initial work
- Frank Geisler (Frank-Geisler): Real-Time Intelligence cmdlets
- Kamil Nowinski (NowinskiK): refactoring, unification and further cmdlets
- Jess Pomfret (jpomfret): automation and PowerShell expertise
- Rob Sewell (SQLDBAWithABeard): automation, DevOps, governance and experience from dbatools
See also everyone who has contributed.
- Rui Romano, whose Fabric PowerShell module is included in FabricTools with his permission.
FabricTools is licensed under the MIT License.
