Skip to content

markgar/FabricPS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FabricPS

FabricPS is a Powershell module that enables easy access to the Fabric API.

https://www.powershellgallery.com/packages?q=fabricps

Sample Script

Here is a sample script for using a user principal with MFA

Import-Module FabricPS -Force
 
Connect-AzAccount | Out-Null

$workspaces = Get-Workspaces
$workspaces

$workspace = New-Workspace -DisplayName "Test Workspace" -Description "A test workspace"
$workspace

$notebook = New-Notebook -WorkspaceId $workspace.id -DisplayName "Test Notebook" -Description "A test notebook"

Here is an example script for using a service principal for automated exeuction

Clear-Host

# Import the FabricPS module
Import-Module FabricPS -Force
 
# Define Service Principal credentials
$clientId       = "{{your-client-id}}"          # Replace with your SP's Application (Client) ID
$tenantId       = "{{your-tenant-id}}"          # Replace with your Azure Tenant ID
$clientSecret   = "{{your-client-secret}}"      # Replace with your SP's Client Secret
 
# Convert the client secret to a SecureString
$secureClientSecret = ConvertTo-SecureString -String $clientSecret -AsPlainText -Force
 
# Create a PSCredential object
$credential = New-Object System.Management.Automation.PSCredential ($clientId, $secureClientSecret)
 
# Connect to Azure using the Service Principal
Connect-AzAccount -ServicePrincipal -Credential $credential -TenantId $tenantId
 
$workspaces = Get-Workspaces
$workspaces

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published