FabricTools v0.33.0 Public Preview

Add-FabricWorkspaceRoleAssignment

Assigns a role to a principal for a specified Fabric workspace.

Syntax

Add-FabricWorkspaceRoleAssignment [-WorkspaceId] <guid> [-PrincipalId] <guid>
 [-PrincipalType] <string> [-WorkspaceRole] <string> [<CommonParameters>]

Description

The Add-FabricWorkspaceRoleAssignments function assigns a role (e.g., Admin, Contributor, Member, Viewer) to a principal (e.g., User, Group, ServicePrincipal) in a Fabric workspace by making a POST request to the API.

Examples

Example 1

Assigns the Admin role to the user with ID "principal123" in the workspace "workspace123".

Add-FabricWorkspaceRoleAssignment -WorkspaceId "workspace123" -PrincipalId "principal123" -PrincipalType "User" -WorkspaceRole "Admin"

Parameters

NameTypeReq.Pos.PipelineDescription
-PrincipalId guid ✓Required 1 –

The unique identifier of the principal (User, Group, etc.) to assign the role.

-PrincipalType string ✓Required 2 –

The type of the principal. Allowed values: Group, ServicePrincipal, ServicePrincipalProfile, User.

-WorkspaceIdalias: Id guid ✓Required 0 –

The unique identifier of the workspace.

-WorkspaceRole string ✓Required 3 –

The role to assign to the principal. Allowed values: Admin, Contributor, Member, Viewer.

This cmdlet also supports the common parameters, such as -Verbose and -ErrorAction. See about_CommonParameters.

Outputs

System.Collections.Hashtable

{{ Fill in the Description }}

Notes

  • Calls Confirm-TokenState to ensure token validity before making the API request.

Author: Tiago Balabuch, Kamil Nowinski