Fabric API Reference¶
Module Functions¶
fabias.client = _create_client
module-attribute
¶
fabias.workspace
¶
Microsoft Fabric Workspace model.
Represents a Fabric workspace and provides access to workspace resources.
Classes¶
Workspace
¶
Represents a Microsoft Fabric workspace.
Provides access to workspace resources including pipelines, lakehouses, notebooks, environments, and Git integration. Resolves workspace identifiers from display names or GUIDs.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Workspace unique identifier (GUID) |
name |
str
|
Workspace display name |
capacityId |
str
|
Capacity GUID hosting this workspace |
description |
str
|
Workspace description |
Examples:
Access via FabricClient:
>>> client = FabricClient()
>>> workspace = client.workspace("GENESIS_EXT")
>>> print(f"Workspace: {workspace.name} ({workspace.id})")
Access workspace resources:
>>> pipeline = workspace.pipeline("Daily ETL")
>>> lakehouse = workspace.lakehouse("Analytics")
>>> git = workspace.git
Source code in src/fabias/_fabric/workspace.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 | |
Attributes¶
capacityId
property
¶
Capacity GUID hosting this workspace (lazy loaded).
description
property
¶
Workspace description (lazy loaded).
environments
property
¶
Access environment list and creation operations.
Returns:
| Name | Type | Description |
|---|---|---|
EnvironmentAccessor |
EnvironmentAccessor
|
Accessor for listing and creating environments |
Examples:
List all environments:
Create new environment:
folders
property
¶
Access folder list and creation operations.
Returns:
| Name | Type | Description |
|---|---|---|
FolderAccessor |
FolderAccessor
|
Accessor for listing and creating folders |
Examples:
List all folders:
List direct children of a folder:
Create new folder:
Create nested folder:
git
property
¶
Get Git integration handler for this workspace.
Returns:
| Name | Type | Description |
|---|---|---|
Git |
Git
|
Git operations handler |
Examples:
id
property
¶
Workspace GUID.
lakehouses
property
¶
Access lakehouse list and creation operations.
Returns:
| Name | Type | Description |
|---|---|---|
LakehouseAccessor |
LakehouseAccessor
|
Accessor for listing and creating lakehouses |
Examples:
List all lakehouses:
Create new lakehouse:
name
property
¶
Workspace display name (lazy loaded).
notebooks
property
¶
Access notebook list and creation operations.
Returns:
| Name | Type | Description |
|---|---|---|
NotebookAccessor |
NotebookAccessor
|
Accessor for listing and creating notebooks |
Examples:
List all notebooks:
Create new notebook:
pipelines
property
¶
Access pipeline list and creation operations.
Returns:
| Name | Type | Description |
|---|---|---|
PipelineAccessor |
PipelineAccessor
|
Accessor for listing and creating pipelines |
Examples:
List all pipelines:
Create new pipeline:
roleAssignments
property
¶
Access role assignments for this workspace.
Returns:
| Name | Type | Description |
|---|---|---|
WorkspaceRoleAssignmentAccessor |
WorkspaceRoleAssignmentAccessor
|
Accessor for listing and managing role assignments |
Examples:
List role assignments:
>>> ws = fabric.workspace("GENESIS")
>>> for assignment in ws.roleAssignments():
... print(f"{assignment.principalName}: {assignment.role}")
Add role assignment:
spark
property
¶
Get Spark settings handler for this workspace.
Returns:
| Name | Type | Description |
|---|---|---|
Spark |
Spark
|
Spark settings handler |
Examples:
Get current Spark settings:
>>> settings = workspace.spark.settings()
>>> print(f"Auto log: {settings.automatic_log}")
>>> print(f"Pool max nodes: {settings.pool_max_nodes}")
Update Spark settings:
variableLibraries
property
¶
Access variable library list and creation operations.
Returns:
| Name | Type | Description |
|---|---|---|
VariableLibraryAccessor |
VariableLibraryAccessor
|
Accessor for listing and creating variable libraries |
Examples:
List all variable libraries:
>>> for lib in workspace.variableLibraries():
... print(f"{lib.name}: active={lib.active_value_set}")
Create new variable library:
Create with initial variables:
>>> import base64, json
>>> variables_json = {
... "$schema": "...",
... "variables": [{"name": "env", "type": "String", "value": "dev"}]
... }
>>> lib = workspace.variableLibraries.add(
... "Deployment Config",
... definition={
... "format": "VariableLibraryV1",
... "parts": [{
... "path": "variables.json",
... "payload": base64.b64encode(
... json.dumps(variables_json).encode()
... ).decode(),
... "payloadType": "InlineBase64"
... }]
... }
... )
Functions¶
__getattr__(name)
¶
Dynamic attribute access for undefined endpoints.
Allows accessing Fabric API endpoints that don't have explicit methods. Converts attribute name to API endpoint and returns a callable or data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Attribute name (will be converted to API endpoint) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Callable |
Callable
|
A function that accepts an optional item_id parameter |
Examples:
List eventhouses (no explicit method defined)¶
Get specific eventhouse¶
Access any Fabric item type¶
Source code in src/fabias/_fabric/workspace.py
__init__(client, workspace_id=None, workspace_data=None)
¶
Initialize workspace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
FabricClient
|
Authenticated FabricClient instance |
required |
workspace_id
|
Optional[str]
|
Workspace identifier (name, GUID, or None for current) |
None
|
workspace_data
|
Optional[dict]
|
Pre-populated workspace data from API (skips resolution) |
None
|
Behavior
- If workspace_data provided: Pre-populate attributes (no API call)
- If GUID provided: Store it without API call (lazy load properties)
- If name provided: Resolve immediately to get GUID (required for operations)
- If None or 'default': Resolve to current workspace (Fabric only)
Raises:
| Type | Description |
|---|---|
NotFoundError
|
If workspace name cannot be found |
FabiasError
|
If not in Fabric and no workspace_id provided |
Source code in src/fabias/_fabric/workspace.py
__repr__()
¶
create(client, name, capacity, description=None)
classmethod
¶
Create a new workspace.
If a workspace with the same name already exists and is in "Active" state, returns the existing workspace. If the workspace exists but is in "Deleted" state, raises an error indicating it must be permanently deleted first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
FabricClient
|
Authenticated FabricClient instance |
required |
name
|
str
|
Display name for the new workspace |
required |
capacity
|
str
|
Capacity GUID to host the workspace |
required |
description
|
Optional[str]
|
Optional workspace description |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Workspace |
Workspace
|
The newly created or existing active workspace |
Raises:
| Type | Description |
|---|---|
FabiasError
|
If workspace exists in "Deleted" state |
Examples:
>>> from fabias.fabric import FabricClient, Workspace
>>> client = FabricClient(auth=auth)
>>> ws = Workspace.create(client, "New Workspace", capacity="...")
Source code in src/fabias/_fabric/workspace.py
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 | |
delete()
¶
Delete this workspace (soft delete).
The workspace enters a retention period (default 7 days, configurable up to 90 days) during which Fabric administrators can restore it using the restore() method.
Example
ws = fabric.workspace("Old Workspace") ws.delete()
Later, restore it:¶
ws.restore()
Source code in src/fabias/_fabric/workspace.py
environment(identifier)
¶
Get a specific environment by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Environment name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Environment |
Environment
|
The environment object |
Examples:
Source code in src/fabias/_fabric/workspace.py
folder(identifier)
¶
Get a specific folder by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Folder display name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Folder |
Folder
|
The folder object |
Examples:
Source code in src/fabias/_fabric/workspace.py
items(item_type=None)
¶
List items in this workspace, converted to specific types.
Returns typed item objects (Pipeline, Notebook, etc.) based on the 'type' field in the API response. Unknown types return base Item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item_type
|
Optional[Union[ItemType, str]]
|
Optional filter by type. Can be ItemType enum or string (e.g., ItemType.DATA_PIPELINE, "DataPipeline", ItemType.NOTEBOOK, "Notebook") |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
list
|
List of Item objects (Pipeline, Notebook, etc.) |
Examples:
All items:
>>> items = workspace.items()
>>> for item in items:
... print(f"{item.name}: {type(item).__name__}")
Filtered by type:
>>> pipelines = workspace.items(item_type="DataPipeline")
>>> notebooks = workspace.items(item_type="Notebook")
Source code in src/fabias/_fabric/workspace.py
lakehouse(identifier)
¶
Get a specific lakehouse by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Lakehouse name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Lakehouse |
Lakehouse
|
The lakehouse object |
Examples:
Source code in src/fabias/_fabric/workspace.py
notebook(identifier)
¶
Get a specific notebook by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Notebook name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Notebook |
Notebook
|
The notebook object |
Examples:
Source code in src/fabias/_fabric/workspace.py
pipeline(identifier)
¶
Get a specific pipeline by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Pipeline name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Pipeline |
Pipeline
|
The pipeline object |
Examples:
Source code in src/fabias/_fabric/workspace.py
restore(new_admin_principal_id=None, new_name=None)
¶
Restore a deleted workspace.
Requires Fabric Administrator privileges. The workspace must be in "Deleted" state within the retention period (7-90 days, default 7).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_admin_principal_id
|
Optional[str]
|
Optional principal ID to assign as workspace admin |
None
|
new_name
|
Optional[str]
|
Optional new name for the workspace (required for My workspaces) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Workspace |
Workspace
|
The restored workspace |
Raises:
| Type | Description |
|---|---|
FabiasError
|
If workspace ID not set or restore fails |
Examples:
>>> # Restore with original settings
>>> deleted_ws = fabric.workspace(workspace_id) # By GUID
>>> deleted_ws.restore()
Source code in src/fabias/_fabric/workspace.py
roleAssignment(principal_id)
¶
Get a specific role assignment by principal ID.
This method accepts a principal ID and looks up the corresponding role assignment. If multiple or no assignments are found, raises an error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
principal_id
|
str
|
Principal GUID (user, group, or service principal) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
WorkspaceRoleAssignment |
WorkspaceRoleAssignment
|
The role assignment |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
If no role assignment found for the principal |
FabiasError
|
If multiple role assignments found (shouldn't happen) |
Examples:
>>> ws = fabric.workspace("GENESIS")
>>> assignment = ws.roleAssignment("user-guid")
>>> print(assignment.role)
Source code in src/fabias/_fabric/workspace.py
variableLibrary(identifier)
¶
Get a specific variable library by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Variable library name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VariableLibrary |
VariableLibrary
|
The variable library object |
Examples:
>>> lib = workspace.variableLibrary("Deployment Config")
>>> print(f"Active value set: {lib.active_value_set}")
Source code in src/fabias/_fabric/workspace.py
WorkspaceAccessor
¶
Accessor for workspace-level operations.
Provides methods to list and create workspaces. Follows the same pattern as PipelineAccessor, LakehouseAccessor, etc.
Supports lazy client loading for module-level usage.
Source code in src/fabias/_fabric/workspace.py
968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 | |
Functions¶
__call__()
¶
List all accessible workspaces.
Returns:
| Type | Description |
|---|---|
list[Workspace]
|
list[Workspace]: List of Workspace objects |
Examples:
>>> import fabias.fabric as fabric
>>> for ws in fabric.workspaces():
... print(f"{ws.name}: {ws.id}")
Source code in src/fabias/_fabric/workspace.py
__init__(client_or_getter)
¶
Initialize workspace accessor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client_or_getter
|
Union[FabricClient, Callable[[], FabricClient]]
|
Either a FabricClient instance or a callable that returns one |
required |
Source code in src/fabias/_fabric/workspace.py
add(name, capacity, description=None)
¶
Create a new workspace.
If a workspace with the same name already exists and is in "Active" state, returns the existing workspace. If the workspace exists but is in "Deleted" state, raises an error indicating it must be permanently deleted first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Display name for the new workspace |
required |
capacity
|
str
|
Capacity GUID to host the workspace |
required |
description
|
Optional[str]
|
Optional workspace description |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Workspace |
Workspace
|
The newly created or existing active workspace |
Raises:
| Type | Description |
|---|---|
FabiasError
|
If workspace exists in "Deleted" state |
Examples:
>>> import fabias.fabric as fabric
>>> new_ws = fabric.workspaces.add("Analytics WS", capacity="...")
Source code in src/fabias/_fabric/workspace.py
1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 | |
delete(name_or_id)
¶
Delete a workspace by name or GUID (soft delete).
The workspace enters a retention period (default 7 days, configurable up to 90 days) during which Fabric administrators can restore it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name_or_id
|
str
|
Workspace name or GUID |
required |
Examples:
Source code in src/fabias/_fabric/workspace.py
restore(workspace_id, new_admin_principal_id=None, new_name=None)
¶
Restore a deleted workspace.
Requires Fabric Administrator privileges. The workspace must be in "Deleted" state within the retention period (7-90 days, default 7).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace_id
|
str
|
GUID of the deleted workspace |
required |
new_admin_principal_id
|
Optional[str]
|
Optional principal ID to assign as workspace admin |
None
|
new_name
|
Optional[str]
|
Optional new name for the workspace (required for My workspaces) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Workspace |
Workspace
|
The restored workspace |
Examples:
>>> # Restore with new admin
>>> ws = fabric.workspaces.restore(
... "workspace-guid",
... new_admin_principal_id="user-guid"
... )
>>> # Restore My workspace with new name
>>> ws = fabric.workspaces.restore(
... "workspace-guid",
... new_name="Restored Workspace"
... )
Source code in src/fabias/_fabric/workspace.py
WorkspaceRoleAssignment
¶
Bases: BaseRoleAssignment
Represents a role assignment for a workspace.
Inherits from BaseRoleAssignment to provide: - principal (dict): Principal information (user/group/service principal) - role (str): Assigned role (e.g., 'Admin', 'Member', 'Contributor', 'Viewer') - principal_id, principal_type, principal_name properties
Workspace-specific roles: - Admin: Full control over the workspace - Member: Can view, edit, and share workspace items - Contributor: Can view and edit workspace items - Viewer: Read-only access to workspace items
Source code in src/fabias/_fabric/workspace.py
WorkspaceRoleAssignmentAccessor
¶
Bases: BaseRoleAssignmentAccessor
Accessor for workspace role assignment operations.
Inherits from BaseRoleAssignmentAccessor to provide: - call(): List all role assignments - add(principal_id, principal_type, role): Add role assignment (with 409 handling) - update(principal_id, role): Update role assignment - delete(principal_id): Delete role assignment
Source code in src/fabias/_fabric/workspace.py
fabias.workspaces = WorkspaceAccessor(_get_client)
module-attribute
¶
fabias.connection(name_or_id)
¶
Get a specific connection by name or ID.
Searches tenant-wide connections by name (case-insensitive partial match). If only one match is found, returns it. If multiple matches or no matches, raises an error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name_or_id
|
str
|
Connection name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Connection |
Connection
|
The connection object |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
If no connection matches the name/ID |
FabiasError
|
If multiple connections match the name |
Examples:
By name:
By GUID:
Source code in src/fabias/_fabric/__init__.py
fabias.connections
¶
Connections management for Microsoft Fabric workspaces.
Provides functionality for managing data connections including on-premises, virtual network, and cloud connections.
Classes¶
Connection
¶
Represents a Fabric connection.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Connection unique identifier |
name |
str
|
Connection display name |
connectionType |
str
|
Type of connection |
connectivityType |
str
|
Connectivity type (OnPremises, VirtualNetwork, Cloud) |
privacyLevel |
str
|
Privacy level setting |
credentialDetails |
dict
|
Credential configuration details |
Source code in src/fabias/_fabric/connections.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
Attributes¶
connectionType
property
¶
Connection type (lazy loaded).
connectivityType
property
¶
Connectivity type (lazy loaded).
credentialDetails
property
¶
Credential details (lazy loaded).
id
property
¶
Connection ID is always available (set in init).
name
property
¶
Connection display name (lazy loaded).
privacyLevel
property
¶
Privacy level (lazy loaded).
roleAssignments
property
¶
Access role assignments for this connection.
Returns:
| Name | Type | Description |
|---|---|---|
RoleAssignmentAccessor |
RoleAssignmentAccessor
|
Accessor for listing and managing role assignments |
Examples:
List role assignments:
>>> conn = fabric.connection("SQL Server")
>>> for assignment in conn.roleAssignments():
... print(f"{assignment.principalName}: {assignment.role}")
Add role assignment:
Functions¶
__init__(client, identifier=None, connection_data=None)
¶
Initialize Connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
FabricClient
|
Authenticated FabricClient |
required |
identifier
|
Optional[str]
|
Connection name or GUID (triggers lazy loading or immediate resolution) |
None
|
connection_data
|
Optional[Dict[str, Any]]
|
Pre-populated connection data from API (skips resolution) |
None
|
Source code in src/fabias/_fabric/connections.py
refresh()
¶
Force refresh connection data from API.
Returns:
| Name | Type | Description |
|---|---|---|
Connection |
Connection
|
Self for method chaining |
Examples:
Source code in src/fabias/_fabric/connections.py
roleAssignment(principal_id)
¶
Get a specific role assignment by principal ID.
This method accepts a principal ID and looks up the corresponding role assignment. If multiple or no assignments are found, raises an error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
principal_id
|
str
|
Principal GUID (user, group, or service principal) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ConnectionRoleAssignment |
ConnectionRoleAssignment
|
The role assignment |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
If no role assignment found for the principal |
FabiasError
|
If multiple role assignments found (shouldn't happen) |
Examples:
>>> conn = fabric.connection("SQL Server")
>>> assignment = conn.roleAssignment("user-guid")
>>> print(assignment.role)
Source code in src/fabias/_fabric/connections.py
ConnectionRoleAssignment
¶
Bases: BaseRoleAssignment
Represents a role assignment for a connection.
Inherits from BaseRoleAssignment to provide: - principal (dict): Principal information (user/group/service principal) - role (str): Assigned role (e.g., 'User', 'Admin', 'Owner') - principal_id, principal_type, principal_name properties
Connection-specific roles: - User: Can use the connection - UserWithReshare: Can use and share the connection - Owner: Full control over the connection
Source code in src/fabias/_fabric/connections.py
Connections
¶
Manages connections for Microsoft Fabric (tenant-wide).
Provides methods to: - List, create, get, update, and delete connections - Manage connection role assignments - Get supported connection types
Note: Connections are tenant-wide resources, not workspace-scoped.
Examples:
>>> import fabias.fabric as fabric
>>> connections = Connections(fabric.client())
>>>
>>> # List all connections
>>> for conn in connections.list():
... print(f"{conn.name}: {conn.connectionType}")
>>>
>>> # Create a connection
>>> conn = connections.create(
... name="MyDataSource",
... connection_type="Sql",
... connectivity_type="OnPremises",
... privacy_level="Organizational"
... )
>>>
>>> # Get a connection
>>> conn = connections.get("connection-id")
>>>
>>> # Update a connection
>>> connections.update("connection-id", display_name="NewName")
>>>
>>> # Delete a connection
>>> connections.delete("connection-id")
Source code in src/fabias/_fabric/connections.py
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 | |
Functions¶
__init__(client)
¶
Initialize Connections handler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
FabricClient
|
Authenticated FabricClient |
required |
create(name, connection_type, connectivity_type='Cloud', privacy_level='Organizational', **kwargs)
¶
Create a new connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Connection display name |
required |
connection_type
|
str
|
Type of connection (e.g., 'Sql', 'AzureBlob', 'SharePoint') |
required |
connectivity_type
|
Union[ConnectivityType, str]
|
ConnectivityType enum or string ('OnPremises', 'VirtualNetwork', 'Cloud') |
'Cloud'
|
privacy_level
|
Union[PrivacyLevel, str]
|
PrivacyLevel enum or string ('None', 'Public', 'Organizational', 'Private') |
'Organizational'
|
**kwargs
|
Any
|
Additional connection properties |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Connection |
Connection
|
The created connection object |
Examples:
Using enums (recommended):
>>> from fabias.fabric.enums import ConnectivityType, PrivacyLevel
>>> conn = connections.create(
... name="SQL Server",
... connection_type="Sql",
... connectivity_type=ConnectivityType.ON_PREMISES_GATEWAY,
... privacy_level=PrivacyLevel.ORGANIZATIONAL
... )
Using strings:
>>> conn = connections.create(
... name="SQL Server",
... connection_type="Sql",
... connectivity_type="OnPremises",
... privacy_level="Organizational"
... )
Source code in src/fabias/_fabric/connections.py
delete(name_or_id)
¶
Delete a connection by name or GUID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name_or_id
|
str
|
Connection name or GUID |
required |
Examples:
Source code in src/fabias/_fabric/connections.py
get(connection_id)
¶
Get a specific connection by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection_id
|
str
|
Connection GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Connection |
Connection
|
The connection object |
Examples:
Source code in src/fabias/_fabric/connections.py
list(name=None)
¶
List all connections (tenant-wide).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Optional[str]
|
Optional filter by connection name (case-insensitive partial match) |
None
|
Returns:
| Type | Description |
|---|---|
List[Connection]
|
List[Connection]: List of connection objects |
Examples:
Source code in src/fabias/_fabric/connections.py
supportedTypes()
¶
List supported connection types.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List[dict]: List of supported connection type configurations |
Examples:
>>> types = connections.supported_types()
>>> for conn_type in types:
... print(conn_type.get('name'))
Source code in src/fabias/_fabric/connections.py
update(connection_id, display_name=None, privacy_level=None, **kwargs)
¶
Update an existing connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection_id
|
str
|
Connection GUID |
required |
display_name
|
Optional[str]
|
New display name (optional) |
None
|
privacy_level
|
Optional[Union[PrivacyLevel, str]]
|
PrivacyLevel enum or string (optional) |
None
|
**kwargs
|
Any
|
Additional properties to update |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Connection |
Connection
|
The updated connection object |
Examples:
Using enum:
>>> from fabias.fabric.enums import PrivacyLevel
>>> conn = connections.update(
... "abc-123",
... display_name="Updated Name",
... privacy_level=PrivacyLevel.PRIVATE
... )
Using string:
>>> conn = connections.update(
... "abc-123",
... display_name="Updated Name",
... privacy_level="Private"
... )
Source code in src/fabias/_fabric/connections.py
ConnectionsAccessor
¶
Accessor for Connection list/create operations.
Source code in src/fabias/_fabric/connections.py
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 | |
Functions¶
__call__()
¶
List all connections.
Automatically handles pagination via continuation tokens.
Returns:
| Type | Description |
|---|---|
List[Connection]
|
list[Connection]: List of Connection objects |
Examples:
>>> import fabias.fabric as fabric
>>> fabric.client(auth=my_auth)
>>>
>>> # List all connections
>>> all_conns = fabric.connections()
Source code in src/fabias/_fabric/connections.py
__init__(client_or_getter)
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client_or_getter
|
Union[FabricClient, Callable[[], FabricClient]]
|
FabricClient or callable returning one (for lazy loading) |
required |
Source code in src/fabias/_fabric/connections.py
add(name, connection_type, connectivity_type, **kwargs)
¶
Create a new connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Connection name |
required |
connection_type
|
str
|
Type of connection (e.g., "Sql", "AzureBlob") |
required |
connectivity_type
|
str
|
"OnPremises", "ShareableCloud", or "NotShareable" |
required |
**kwargs
|
Any
|
Additional properties (privacy_level, credential_details, etc.) |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Connection |
Connection
|
The created Connection object |
Examples:
>>> conn = fabric.connections.add(
... name="My SQL Server",
... connection_type="Sql",
... connectivity_type="OnPremises",
... privacy_level="Organizational"
... )
Source code in src/fabias/_fabric/connections.py
get(connection_id)
¶
Get a connection by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection_id
|
str
|
Connection GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Connection |
Connection
|
The Connection object |
Examples:
Source code in src/fabias/_fabric/connections.py
RoleAssignmentAccessor
¶
Bases: BaseRoleAssignmentAccessor
Accessor for connection role assignment operations.
Inherits from BaseRoleAssignmentAccessor to provide: - call(): List all role assignments - add(principal_id, principal_type, role): Add role assignment (with 409 handling) - update(principal_id, role): Update role assignment - delete(principal_id): Delete role assignment
Source code in src/fabias/_fabric/connections.py
fabias.capacity(name_or_id)
¶
Get a specific capacity by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name_or_id
|
str
|
Capacity display name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Capacity |
Capacity
|
The capacity object |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
If capacity not found |
FabiasError
|
If multiple capacities match |
Examples:
By name:
>>> capacity = fabric.capacity("Premium-P1")
>>> print(f"SKU: {capacity.sku}, Region: {capacity.region}")
By GUID:
Note
Requires Capacity Admin or Fabric Administrator permissions.
Source code in src/fabias/_fabric/__init__.py
fabias.capacities = CapacitiesAccessor(_get_client)
module-attribute
¶
Classes¶
fabias.Workspace
¶
Represents a Microsoft Fabric workspace.
Provides access to workspace resources including pipelines, lakehouses, notebooks, environments, and Git integration. Resolves workspace identifiers from display names or GUIDs.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Workspace unique identifier (GUID) |
name |
str
|
Workspace display name |
capacityId |
str
|
Capacity GUID hosting this workspace |
description |
str
|
Workspace description |
Examples:
Access via FabricClient:
>>> client = FabricClient()
>>> workspace = client.workspace("GENESIS_EXT")
>>> print(f"Workspace: {workspace.name} ({workspace.id})")
Access workspace resources:
>>> pipeline = workspace.pipeline("Daily ETL")
>>> lakehouse = workspace.lakehouse("Analytics")
>>> git = workspace.git
Source code in src/fabias/_fabric/workspace.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 | |
Attributes¶
id
property
¶
Workspace GUID.
name
property
¶
Workspace display name (lazy loaded).
capacityId
property
¶
Capacity GUID hosting this workspace (lazy loaded).
description
property
¶
Workspace description (lazy loaded).
pipelines
property
¶
Access pipeline list and creation operations.
Returns:
| Name | Type | Description |
|---|---|---|
PipelineAccessor |
PipelineAccessor
|
Accessor for listing and creating pipelines |
Examples:
List all pipelines:
Create new pipeline:
lakehouses
property
¶
Access lakehouse list and creation operations.
Returns:
| Name | Type | Description |
|---|---|---|
LakehouseAccessor |
LakehouseAccessor
|
Accessor for listing and creating lakehouses |
Examples:
List all lakehouses:
Create new lakehouse:
notebooks
property
¶
Access notebook list and creation operations.
Returns:
| Name | Type | Description |
|---|---|---|
NotebookAccessor |
NotebookAccessor
|
Accessor for listing and creating notebooks |
Examples:
List all notebooks:
Create new notebook:
environments
property
¶
Access environment list and creation operations.
Returns:
| Name | Type | Description |
|---|---|---|
EnvironmentAccessor |
EnvironmentAccessor
|
Accessor for listing and creating environments |
Examples:
List all environments:
Create new environment:
variableLibraries
property
¶
Access variable library list and creation operations.
Returns:
| Name | Type | Description |
|---|---|---|
VariableLibraryAccessor |
VariableLibraryAccessor
|
Accessor for listing and creating variable libraries |
Examples:
List all variable libraries:
>>> for lib in workspace.variableLibraries():
... print(f"{lib.name}: active={lib.active_value_set}")
Create new variable library:
Create with initial variables:
>>> import base64, json
>>> variables_json = {
... "$schema": "...",
... "variables": [{"name": "env", "type": "String", "value": "dev"}]
... }
>>> lib = workspace.variableLibraries.add(
... "Deployment Config",
... definition={
... "format": "VariableLibraryV1",
... "parts": [{
... "path": "variables.json",
... "payload": base64.b64encode(
... json.dumps(variables_json).encode()
... ).decode(),
... "payloadType": "InlineBase64"
... }]
... }
... )
git
property
¶
Get Git integration handler for this workspace.
Returns:
| Name | Type | Description |
|---|---|---|
Git |
Git
|
Git operations handler |
Examples:
roleAssignments
property
¶
Access role assignments for this workspace.
Returns:
| Name | Type | Description |
|---|---|---|
WorkspaceRoleAssignmentAccessor |
WorkspaceRoleAssignmentAccessor
|
Accessor for listing and managing role assignments |
Examples:
List role assignments:
>>> ws = fabric.workspace("GENESIS")
>>> for assignment in ws.roleAssignments():
... print(f"{assignment.principalName}: {assignment.role}")
Add role assignment:
Functions¶
pipeline(identifier)
¶
Get a specific pipeline by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Pipeline name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Pipeline |
Pipeline
|
The pipeline object |
Examples:
Source code in src/fabias/_fabric/workspace.py
lakehouse(identifier)
¶
Get a specific lakehouse by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Lakehouse name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Lakehouse |
Lakehouse
|
The lakehouse object |
Examples:
Source code in src/fabias/_fabric/workspace.py
notebook(identifier)
¶
Get a specific notebook by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Notebook name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Notebook |
Notebook
|
The notebook object |
Examples:
Source code in src/fabias/_fabric/workspace.py
environment(identifier)
¶
Get a specific environment by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Environment name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Environment |
Environment
|
The environment object |
Examples:
Source code in src/fabias/_fabric/workspace.py
variableLibrary(identifier)
¶
Get a specific variable library by name or ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
Variable library name or GUID |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VariableLibrary |
VariableLibrary
|
The variable library object |
Examples:
>>> lib = workspace.variableLibrary("Deployment Config")
>>> print(f"Active value set: {lib.active_value_set}")
Source code in src/fabias/_fabric/workspace.py
items(item_type=None)
¶
List items in this workspace, converted to specific types.
Returns typed item objects (Pipeline, Notebook, etc.) based on the 'type' field in the API response. Unknown types return base Item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item_type
|
Optional[Union[ItemType, str]]
|
Optional filter by type. Can be ItemType enum or string (e.g., ItemType.DATA_PIPELINE, "DataPipeline", ItemType.NOTEBOOK, "Notebook") |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
list
|
List of Item objects (Pipeline, Notebook, etc.) |
Examples:
All items:
>>> items = workspace.items()
>>> for item in items:
... print(f"{item.name}: {type(item).__name__}")
Filtered by type:
>>> pipelines = workspace.items(item_type="DataPipeline")
>>> notebooks = workspace.items(item_type="Notebook")
Source code in src/fabias/_fabric/workspace.py
roleAssignment(principal_id)
¶
Get a specific role assignment by principal ID.
This method accepts a principal ID and looks up the corresponding role assignment. If multiple or no assignments are found, raises an error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
principal_id
|
str
|
Principal GUID (user, group, or service principal) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
WorkspaceRoleAssignment |
WorkspaceRoleAssignment
|
The role assignment |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
If no role assignment found for the principal |
FabiasError
|
If multiple role assignments found (shouldn't happen) |
Examples:
>>> ws = fabric.workspace("GENESIS")
>>> assignment = ws.roleAssignment("user-guid")
>>> print(assignment.role)
Source code in src/fabias/_fabric/workspace.py
delete()
¶
Delete this workspace (soft delete).
The workspace enters a retention period (default 7 days, configurable up to 90 days) during which Fabric administrators can restore it using the restore() method.
Example
ws = fabric.workspace("Old Workspace") ws.delete()
Later, restore it:¶
ws.restore()
Source code in src/fabias/_fabric/workspace.py
restore(new_admin_principal_id=None, new_name=None)
¶
Restore a deleted workspace.
Requires Fabric Administrator privileges. The workspace must be in "Deleted" state within the retention period (7-90 days, default 7).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_admin_principal_id
|
Optional[str]
|
Optional principal ID to assign as workspace admin |
None
|
new_name
|
Optional[str]
|
Optional new name for the workspace (required for My workspaces) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Workspace |
Workspace
|
The restored workspace |
Raises:
| Type | Description |
|---|---|
FabiasError
|
If workspace ID not set or restore fails |
Examples:
>>> # Restore with original settings
>>> deleted_ws = fabric.workspace(workspace_id) # By GUID
>>> deleted_ws.restore()
Source code in src/fabias/_fabric/workspace.py
fabias.Pipeline
¶
Bases: Item
Represents a Microsoft Fabric Data Pipeline.
Provides methods to execute pipelines and track execution status.
Examples:
>>> pipeline = workspace.pipeline("Daily ETL")
>>> job = pipeline.run()
>>> job.wait()
>>> print(f"Status: {job.status}")
With parameters:
>>> job = pipeline.run(parameters={
... "StartDate": "2025-01-01",
... "EndDate": "2025-01-31"
... })
Source code in src/fabias/_fabric/items/pipeline.py
Functions¶
run(parameters=None)
¶
Execute the pipeline.
Starts an asynchronous pipeline run and returns a Job for tracking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameters
|
Optional[Dict[str, str]]
|
Optional pipeline parameters as key-value pairs |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Job |
AzResponse
|
Job object for monitoring execution |
Raises:
| Type | Description |
|---|---|
FabiasError
|
If pipeline execution fails to start |
Source code in src/fabias/_fabric/items/pipeline.py
fabias.Lakehouse
¶
Bases: Item
Represents a Microsoft Fabric Lakehouse.
Provides access to lakehouse metadata and OneLake data access security (ABAC). Lakehouses are Delta Lake storage containers used for analytics workloads.
Examples:
>>> lakehouse = workspace.lakehouse("Analytics")
>>> print(f"Lakehouse ID: {lakehouse.id}")
>>>
>>> # Manage data access roles (ABAC)
>>> roles = lakehouse.accessRoles()
>>> role = lakehouse.accessRole("DefaultReader")
Source code in src/fabias/_fabric/items/lakehouse.py
fabias.VariableLibrary
¶
Bases: Item
Represents a Microsoft Fabric Variable Library.
Variable libraries store typed named variables and alternative value sets for use in application lifecycle management (ALM) pipelines. Different value sets can be activated per deployment stage (dev/test/prod) allowing the same pipeline run with different configurations.
Variable types: Boolean, DateTime, Number, Integer, String, ItemReference
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Variable library GUID |
name |
str
|
Display name |
description |
str
|
Description |
active_value_set |
str | None
|
Name of the currently active value set |
Examples:
Get a variable library:
>>> lib = workspace.variableLibrary("Deployment Config")
>>> print(f"Active value set: {lib.active_value_set}")
Activate a different value set:
Retrieve the full definition (variables + value sets):
Set variables in bulk (SDK handles all encoding):
>>> lib.setVariables([
... {"name": "environment", "type": "String", "value": "dev"},
... {"name": "maxRetries", "type": "Integer", "value": 3},
... ])
Manage value sets:
>>> lib.setValueSet("Production", {"environment": "prod", "maxRetries": "10"})
>>> lib.valueSets() # [{"name": "Production", "variableOverrides": [...]}]
Source code in src/fabias/_fabric/items/variablelibrary.py
711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 | |
Attributes¶
variables = VariableAccessor(self)
instance-attribute
¶
Functions¶
variable(name)
¶
Return a single variable by name.
Shorthand for lib.variables[name].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Variable name |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Variable |
Variable
|
The variable |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the variable does not exist |
Examples:
Source code in src/fabias/_fabric/items/variablelibrary.py
valueSets()
¶
Return all value sets as a plain list of decoded dicts.
Each value set has name, optionally description, and
variableOverrides — a list of {name, value} pairs.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
list[dict]: Value sets decoded from |
Examples:
Source code in src/fabias/_fabric/items/variablelibrary.py
setValueSet(name, overrides, description=None)
¶
Create or update a value set.
Fetches the current definition, adds or replaces the named value set part, and pushes the full updated definition back. Handles LRO.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Value set name (also the filename — |
required |
overrides
|
Dict[str, Any]
|
Variable overrides as |
required |
description
|
Optional[str]
|
Optional description for the value set |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
VariableLibrary |
VariableLibrary
|
Self for method chaining |
Examples:
Source code in src/fabias/_fabric/items/variablelibrary.py
deleteValueSet(name)
¶
Remove a value set from the library.
Fetches the current definition, drops the named value set part, and pushes the updated definition back. Handles LRO.
Note
You cannot delete the currently active value set. Call
:meth:activateValueSet on a different value set first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the value set to delete |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VariableLibrary |
VariableLibrary
|
Self for method chaining |
Examples:
Source code in src/fabias/_fabric/items/variablelibrary.py
activateValueSet(name)
¶
Set the active value set for this variable library.
The active value set determines which variable overrides are in effect. Only one value set can be active at a time. You cannot delete an active value set—activate another first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the value set to activate |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VariableLibrary |
VariableLibrary
|
Self for method chaining ( |
Raises:
| Type | Description |
|---|---|
FabiasError
|
If the update request fails |
Examples:
Switch back to default:
Source code in src/fabias/_fabric/items/variablelibrary.py
setVariables(variables)
¶
Replace all variables in bulk.
Fetches the current definition to preserve existing value sets and
settings, replaces the variables.json part, and pushes the full
updated definition back. Handles LRO transparently.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
variables
|
List[Dict[str, Any]]
|
List of variable dicts. Each must have |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VariableLibrary |
VariableLibrary
|
Self for method chaining |
Examples:
>>> lib.setVariables([
... {"name": "environment", "type": "String", "value": "prod"},
... {"name": "maxRetries", "type": "Integer", "value": 5},
... ])
Source code in src/fabias/_fabric/items/variablelibrary.py
updateDefinition(parts, update_metadata=False)
¶
Override the variable library definition with raw parts.
Replaces the entire definition with the provided parts. Parts must include
at minimum variables.json. Use valueSets/<name>.json for value sets
and settings.json for ordering. Handles long-running operations (LRO)
transparently — blocks until the operation completes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parts
|
List[Dict[str, Any]]
|
List of definition part dicts, each with:
|
required |
Returns:
| Name | Type | Description |
|---|---|---|
VariableLibrary |
VariableLibrary
|
Self for method chaining (state refreshed from API) |
Note
Prefer :meth:setVariables and :meth:setValueSet for common
use cases — they handle all encoding automatically.
Source code in src/fabias/_fabric/items/variablelibrary.py
refresh()
¶
Refresh variable library metadata from the API.
Fetches the latest state including active_value_set.
Returns:
| Name | Type | Description |
|---|---|---|
VariableLibrary |
VariableLibrary
|
Self for method chaining |
Examples:
Source code in src/fabias/_fabric/items/variablelibrary.py
update(name=None, description=None, valueSet=None)
¶
Update variable library metadata.
Uses the VariableLibraries-specific PATCH endpoint, which also preserves
the active_value_set in the returned response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Optional[str]
|
New display name |
None
|
description
|
Optional[str]
|
New description (max 256 characters) |
None
|
valueSet
|
Optional[str]
|
Name of the value set to activate (alternative to calling :meth: |
None
|
Returns: VariableLibrary: Self for method chaining
Examples:
>>> lib.update(description="Updated for production deployment")
>>> lib.update(name="Prod Config", description="Production variables")
Source code in src/fabias/_fabric/items/variablelibrary.py
delete()
¶
Delete this variable library.
Warning: This operation is permanent and cannot be undone.
Examples:
Source code in src/fabias/_fabric/items/variablelibrary.py
fabias.VariableAccessor
¶
Lazy-loading, cache-backed accessor for variables in a :class:VariableLibrary.
Fetches the variable collection once on first access, then all reads and
in-memory mutations are zero-cost. Call :meth:commit when finished to push
all accumulated changes in a single updateDefinition call.
Read access::
var = lib.variables["environment"] # Variable — KeyError if missing
var = lib.variables.get("region") # Variable or None
exists = "maxRetries" in lib.variables
all = lib.variables() # List[Variable]
for var in lib.variables: ...
for name, var in lib.variables.items(): ...
In-memory mutation (zero API calls)::
lib.variables.add("region", "String", "eastus")
lib.variables["environment"].value = "prod" # direct field mutation
lib.variables.remove("legacyFlag")
Commit everything at once::
lib.variables.commit() # one updateDefinition call
# Or chain before committing
lib.variables.add("region", "String", "eastus").add("tier", "String", "standard").commit()
Source code in src/fabias/_fabric/items/variablelibrary.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 | |
Functions¶
__call__()
¶
add(name_or_variable, value=None, type=None, note=None)
¶
Add a variable to the in-memory collection.
Does not call the API. Call :meth:commit when finished.
Accepts either a :class:Variable object (with overrides pre-populated)
or individual parameters for quick additions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name_or_variable
|
Union[str, Variable]
|
A :class: |
required |
type
|
Optional[str]
|
Fabric type — |
None
|
value
|
Any
|
Value (only used when |
None
|
note
|
Optional[str]
|
Optional note (only used when |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
VariableAccessor |
VariableAccessor
|
Self for chaining |
Examples:
Quick add — type inferred from value:
>>> lib.variables.add("region", "eastus").commit() # → String
>>> lib.variables.add("retries", 3).commit() # → Integer
>>> lib.variables.add("enabled", True).commit() # → Boolean
Explicit type (required for Guid):
With a pre-built Variable (including overrides):
>>> var = Variable("region", "eastus",
... overrides={"Production": "westus2", "Staging": "centralus"})
>>> lib.variables.add(var).commit()
Duplicate names are silently replaced (upsert):
Source code in src/fabias/_fabric/items/variablelibrary.py
fabias.Variable
dataclass
¶
Represents a single variable in a variable library.
type is optional — it is inferred from the Python type of value when
omitted::
Variable("region", "eastus") # str → "String"
Variable("retries", 3) # int → "Integer"
Variable("ratio", 0.5) # float → "Number"
Variable("enabled", True) # bool → "Boolean"
Variable("lh", ItemReference(...)) # → "ItemReference"
Variable("ts", datetime(2024, 1, 1)) # → "DateTime"
Guid values are stored as Python strings and cannot be distinguished from
String automatically — pass type="Guid" explicitly when needed.
Source code in src/fabias/_fabric/items/variablelibrary.py
Attributes¶
name = name
instance-attribute
¶
type = resolved
instance-attribute
¶
value = cast(Union[bool, str, int, float, ItemReference, datetime], _coerce_value(resolved, value))
instance-attribute
¶
note = note or ''
class-attribute
instance-attribute
¶
overrides = overrides
class-attribute
instance-attribute
¶
Functions¶
override(value_set, value)
¶
Add or update an override value for a specific value set.
Source code in src/fabias/_fabric/items/variablelibrary.py
fabias.ItemReference
dataclass
¶
Represents a reference to another item, used for ItemReference variable types.
Source code in src/fabias/_fabric/items/variablelibrary.py
fabias.Connection
¶
Represents a Fabric connection.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Connection unique identifier |
name |
str
|
Connection display name |
connectionType |
str
|
Type of connection |
connectivityType |
str
|
Connectivity type (OnPremises, VirtualNetwork, Cloud) |
privacyLevel |
str
|
Privacy level setting |
credentialDetails |
dict
|
Credential configuration details |
Source code in src/fabias/_fabric/connections.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
Attributes¶
connectionType
property
¶
Connection type (lazy loaded).
connectivityType
property
¶
Connectivity type (lazy loaded).
credentialDetails
property
¶
Credential details (lazy loaded).
id
property
¶
Connection ID is always available (set in init).
name
property
¶
Connection display name (lazy loaded).
privacyLevel
property
¶
Privacy level (lazy loaded).
roleAssignments
property
¶
Access role assignments for this connection.
Returns:
| Name | Type | Description |
|---|---|---|
RoleAssignmentAccessor |
RoleAssignmentAccessor
|
Accessor for listing and managing role assignments |
Examples:
List role assignments:
>>> conn = fabric.connection("SQL Server")
>>> for assignment in conn.roleAssignments():
... print(f"{assignment.principalName}: {assignment.role}")
Add role assignment:
Functions¶
__init__(client, identifier=None, connection_data=None)
¶
Initialize Connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
FabricClient
|
Authenticated FabricClient |
required |
identifier
|
Optional[str]
|
Connection name or GUID (triggers lazy loading or immediate resolution) |
None
|
connection_data
|
Optional[Dict[str, Any]]
|
Pre-populated connection data from API (skips resolution) |
None
|
Source code in src/fabias/_fabric/connections.py
refresh()
¶
Force refresh connection data from API.
Returns:
| Name | Type | Description |
|---|---|---|
Connection |
Connection
|
Self for method chaining |
Examples:
Source code in src/fabias/_fabric/connections.py
roleAssignment(principal_id)
¶
Get a specific role assignment by principal ID.
This method accepts a principal ID and looks up the corresponding role assignment. If multiple or no assignments are found, raises an error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
principal_id
|
str
|
Principal GUID (user, group, or service principal) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ConnectionRoleAssignment |
ConnectionRoleAssignment
|
The role assignment |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
If no role assignment found for the principal |
FabiasError
|
If multiple role assignments found (shouldn't happen) |
Examples:
>>> conn = fabric.connection("SQL Server")
>>> assignment = conn.roleAssignment("user-guid")
>>> print(assignment.role)
Source code in src/fabias/_fabric/connections.py
fabias.Capacity
¶
Represents a Fabric capacity.
Capacities provide compute and storage resources for Fabric workspaces.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Capacity GUID |
display_name |
str
|
Capacity display name |
sku |
str
|
Capacity SKU (e.g., "F2", "F4", "P1") |
region |
str
|
Azure region |
state |
str
|
Capacity state (Active, Paused, etc.) |
admins |
list
|
List of capacity administrators |
Examples:
>>> capacity = fabric.capacity("Premium-P1")
>>> print(f"SKU: {capacity.sku}, Region: {capacity.region}")
>>>
>>> # Manage workspace assignments
>>> ws = fabric.workspace("Analytics")
>>> capacity.addWorkspace(ws)
>>> capacity.removeWorkspace(ws)
Source code in src/fabias/_fabric/admin/capacity.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | |
Attributes¶
admins
property
¶
List of capacity administrator IDs (lazy loaded).
displayName
property
¶
Capacity display name (lazy loaded).
id
property
¶
Capacity GUID.
region
property
¶
Azure region (lazy loaded).
sku
property
¶
Capacity SKU (lazy loaded).
state
property
¶
Capacity state (lazy loaded).
Functions¶
__init__(client, identifier=None, capacity_data=None)
¶
Initialize Capacity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
FabricClient
|
Authenticated FabricClient |
required |
identifier
|
Optional[str]
|
Capacity name or GUID (triggers lazy loading or immediate resolution) |
None
|
capacity_data
|
Optional[Dict[str, Any]]
|
Pre-populated capacity data from API (skips resolution) |
None
|
Source code in src/fabias/_fabric/admin/capacity.py
addWorkspace(workspace)
¶
Assign a workspace to this capacity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace
|
Workspace
|
Workspace object to assign |
required |
Examples:
>>> capacity = fabric.capacity("Premium-P1")
>>> ws = fabric.workspace("Analytics")
>>> capacity.addWorkspace(ws)
Source code in src/fabias/_fabric/admin/capacity.py
refresh()
¶
Force refresh capacity data from API.
Returns:
| Name | Type | Description |
|---|---|---|
Capacity |
Capacity
|
Self for method chaining |
removeWorkspace(workspace)
¶
Unassign a workspace from this capacity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace
|
Workspace
|
Workspace object to unassign |
required |
Examples:
>>> capacity = fabric.capacity("Premium-P1")
>>> ws = fabric.workspace("Analytics")
>>> capacity.removeWorkspace(ws)
Source code in src/fabias/_fabric/admin/capacity.py
workspaces()
¶
List all workspaces assigned to this capacity.
Returns:
| Type | Description |
|---|---|
List[Workspace]
|
list[Workspace]: Workspaces in this capacity |
Examples:
>>> capacity = fabric.capacity("Premium-P1")
>>> for ws in capacity.workspaces():
... print(ws.name)
Source code in src/fabias/_fabric/admin/capacity.py
fabias.Tenant
¶
Represents the Fabric tenant and provides access to tenant-level settings.
This is a singleton-style class - there's only one tenant per authentication context.
Examples:
>>> tenant = fabric.tenant
>>>
>>> # List all settings
>>> for setting in tenant.settings():
... print(f"{setting.title}: {setting.enabled}")
>>>
>>> # Get specific setting
>>> setting = tenant.setting("AdminApisIncludeDetailedMetadata")
>>> print(f"Enabled: {setting.enabled}")
Source code in src/fabias/_fabric/admin/tenant.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
Functions¶
__init__(client)
¶
Initialize Tenant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
FabricClient
|
Authenticated FabricClient |
required |
activityEvents(start, end, filter=None)
¶
Get Power BI / Fabric activity events for a time range.
Calls GET https://api.powerbi.com/v1.0/myorg/admin/activityevents
and returns all events, automatically following continuation pages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
Union[str, datetime]
|
Start of time range — |
required |
end
|
Union[str, datetime]
|
End of time range — |
required |
filter
|
Optional[str]
|
Optional OData filter to narrow results
(e.g., |
None
|
Returns:
| Type | Description |
|---|---|
List[ActivityEvent]
|
list[ActivityEvent]: All matching activity events. |
Note
Requires Tenant.Read.All (or Tenant.ReadWrite.All) permission
and the Power BI service principal scope
https://analysis.windows.net/powerbi/api/.default.
Source code in src/fabias/_fabric/admin/tenant.py
setting(setting_name)
¶
Get a specific tenant setting by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting_name
|
str
|
Setting identifier (e.g., "AdminApisIncludeDetailedMetadata") |
required |
Returns:
| Name | Type | Description |
|---|---|---|
TenantSetting |
Optional[TenantSetting]
|
The setting, or None if not found |
Examples:
>>> tenant = fabric.tenant
>>> setting = tenant.setting("DatamartTenant")
>>> if setting:
... print(f"Enabled: {setting.enabled}")
Source code in src/fabias/_fabric/admin/tenant.py
settings()
¶
List all tenant settings.
Automatically handles pagination via continuation tokens.
Returns:
| Type | Description |
|---|---|
List[TenantSetting]
|
list[TenantSetting]: All tenant settings |
Examples:
>>> tenant = fabric.tenant
>>> settings = tenant.settings()
>>>
>>> # Filter by group
>>> export_settings = [
... s for s in settings
... if s.tenant_setting_group == "ExportAndSharing"
... ]
Source code in src/fabias/_fabric/admin/tenant.py
updateSetting(setting_name, enabled, enabled_security_groups=None, excluded_security_groups=None)
¶
Update a tenant setting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setting_name
|
str
|
Setting identifier |
required |
enabled
|
bool
|
Enable or disable the setting |
required |
enabled_security_groups
|
Optional[List[str]]
|
Optional list of security group IDs to enable for |
None
|
excluded_security_groups
|
Optional[List[str]]
|
Optional list of security group IDs to exclude |
None
|
Examples:
>>> tenant = fabric.tenant
>>> tenant.updateSetting(
... "DatamartTenant",
... enabled=True,
... enabled_security_groups=["group-guid-1", "group-guid-2"]
... )
Note
This operation requires Fabric Administrator permissions and may require PIM (Privileged Identity Management) elevation.
Source code in src/fabias/_fabric/admin/tenant.py
fabias.Folder
¶
Represents a folder in a Fabric workspace.
Folders organize workspace items into a hierarchical structure. Supports lazy loading: when created with a GUID, properties are fetched on first access.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Folder unique identifier (GUID) |
name |
str
|
Folder display name |
workspace_id |
str
|
Parent workspace GUID |
parent |
str
|
Parent folder GUID, or None if at workspace root |
Examples:
Get a folder:
Get a nested folder by path:
List all folders:
Create a subfolder:
Move a folder:
Rename a folder:
Source code in src/fabias/_fabric/folders.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |
Attributes¶
id
property
¶
Folder ID (always available after init).
name
property
¶
Folder display name. Triggers lazy load if needed.
parent
property
¶
Parent folder ID (None if at workspace root). Triggers lazy load if needed.
workspace_id
property
¶
Workspace ID this folder belongs to.
Functions¶
__init__(client, workspace_id, identifier=None, folder_data=None)
¶
Initialize Folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
FabricClient
|
Authenticated FabricClient |
required |
workspace_id
|
str
|
Workspace GUID containing the folder |
required |
identifier
|
Optional[str]
|
Folder name, GUID, or slash-separated path
(e.g. |
None
|
folder_data
|
Optional[Dict[str, Any]]
|
Pre-populated folder data from API (skips resolution) |
None
|
Source code in src/fabias/_fabric/folders.py
delete()
¶
Delete this folder.
The folder must be empty (no items or nested folders).
Raises:
| Type | Description |
|---|---|
FabiasError
|
If folder is not empty |
Examples:
Source code in src/fabias/_fabric/folders.py
move(target_folder_id=None)
¶
Move this folder within the workspace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_folder_id
|
Optional[str]
|
Destination folder GUID. If None, moves to workspace root. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Folder |
Folder
|
self (updated with new parent) |
Raises:
| Type | Description |
|---|---|
FabiasError
|
If move would create circular hierarchy |
Examples:
Move into another folder:
Move to workspace root:
Source code in src/fabias/_fabric/folders.py
refresh()
¶
Force refresh folder data from API.
Returns:
| Name | Type | Description |
|---|---|---|
Folder |
Folder
|
self (for method chaining) |
rename(name)
¶
Rename this folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
New folder name |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Folder |
Folder
|
self (updated with new name) |
Examples:
Source code in src/fabias/_fabric/folders.py
fabias.Notebook
¶
Bases: Item
Represents a Microsoft Fabric Notebook.
Provides access to notebook metadata and content.
Examples:
>>> notebook = workspace.notebook("ETL Processing")
>>> print(f"Notebook: {notebook.name} ({notebook.id})")
>>> # Get notebook definition (long-running operation)
>>> response = notebook.getDefinition()
>>> response.wait()
>>> definition = response.result()
>>>
>>> # Decode notebook content from base64
>>> files = notebook.definition.files
>>> for file in files:
... print(f"{file.path}: {file.content[:100]}...")
Source code in src/fabias/_fabric/items/notebook.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
Functions¶
getDefinition(format=NotebookFormat.GITSOURCE, freshLoad=False)
¶
Get notebook definition and content (returns long-running operation).
This initiates an async operation to retrieve the notebook's definition, which includes the notebook content encoded as base64.
Attributes:
| Name | Type | Description |
|---|---|---|
format |
NotebookFormat
|
Desired notebook format (currently only GITSOURCE supported) |
freshLoad |
bool
|
If True, bypasses cached definition and fetches anew |
Returns:
| Type | Description |
|---|---|
NotebookDefinition
|
List[Dict[str, Any]]: Files or file sections contained in definition |
Examples:
>>> response = notebook.getDefinition()
>>> response.wait()
>>> definition = response.result()
>>> print(definition['definition']['parts'])
Source code in src/fabias/_fabric/items/notebook.py
fabias.Environment
¶
Represents a Microsoft Fabric Environment with full management capabilities.
Provides methods to: - Check environment status and publish state - Publish pending changes - Cancel publishing - Manage custom libraries
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Environment GUID |
name |
str
|
Environment display name |
state |
str
|
Current publish state (Running, Success, Failed, etc.) |
Examples:
>>> env = workspace.environment("ML Environment")
>>>
>>> # Check publish state
>>> env.refresh()
>>> if env.isPublishing:
... print("Publishing in progress...")
>>>
>>> # Manage libraries
>>> libs = env.libraries
>>> await libs.upload("my_package.whl")
>>> env.publish()
Source code in src/fabias/_fabric/items/environment.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
Attributes¶
isPublishing
property
¶
Check if environment is currently publishing.
libraries
property
¶
Get library manager for this environment.
Returns:
| Name | Type | Description |
|---|---|---|
Libraries |
Libraries
|
Library management interface |
Functions¶
__init__(client, workspace_id, identifier=None, item_data=None)
¶
Initialize Environment with resolution or pre-populated data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
FabricClient
|
Authenticated FabricClient |
required |
workspace_id
|
str
|
Workspace GUID |
required |
identifier
|
Optional[str]
|
Environment display name or GUID (optional if item_data provided) |
None
|
item_data
|
Optional[Dict[str, Any]]
|
Pre-populated item data from API (skips resolution) |
None
|
Source code in src/fabias/_fabric/items/environment.py
cancelPublish()
¶
Cancel an in-progress publish operation.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dict[str, Any]
|
Cancel response with updated state |
Source code in src/fabias/_fabric/items/environment.py
publish()
¶
Publish pending environment changes.
Initiates publishing of staged library changes. This is a long-running operation.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dict[str, Any]
|
Publish response with state information |
Raises:
| Type | Description |
|---|---|
FabiasError
|
If publish fails to initiate |
Source code in src/fabias/_fabric/items/environment.py
refresh()
¶
Refresh environment data from API.
Returns:
| Name | Type | Description |
|---|---|---|
Environment |
Environment
|
Self for method chaining |
Source code in src/fabias/_fabric/items/environment.py
waitForPublish(callback=None, timeout=1800, poll_interval=30)
¶
Wait for publishing to complete.
Polls the environment status until publishing completes or fails.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
Optional[Callable[[Environment], None]]
|
Optional callback(Environment) called after each poll |
None
|
timeout
|
int
|
Maximum seconds to wait |
1800
|
poll_interval
|
int
|
Seconds between status checks |
30
|
Returns:
| Name | Type | Description |
|---|---|---|
Environment |
Environment
|
Self with final publish state |
Raises:
| Type | Description |
|---|---|
FabiasError
|
If timeout reached or publish fails |
Source code in src/fabias/_fabric/items/environment.py
fabias.Libraries
¶
Manages custom libraries in a Microsoft Fabric Environment.
Provides methods to: - List staging and published libraries - Upload new libraries (wheel, py, jar, tar.gz) - Delete libraries from staging - Replace existing libraries with new versions
Examples:
>>> env = workspace.environment("ML Environment")
>>> libs = env.libraries
>>>
>>> # Get current libraries
>>> libs.refresh()
>>> print(libs.staging)
>>>
>>> # Upload a new library
>>> libs.upload("/path/to/my_package-1.0.0-py3-none-any.whl")
>>>
>>> # Replace an existing library
>>> libs.replace("my_package", "/path/to/my_package-1.1.0-py3-none-any.whl")
Source code in src/fabias/_fabric/items/libraries.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
Functions¶
__init__(client, workspace_id, environment_id)
¶
Initialize library manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
FabricClient
|
Authenticated FabricClient |
required |
workspace_id
|
str
|
Workspace GUID |
required |
environment_id
|
str
|
Environment GUID |
required |
Source code in src/fabias/_fabric/items/libraries.py
delete(filename)
¶
Delete a library from staging.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Name of the library file to delete |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if deletion succeeded |
Source code in src/fabias/_fabric/items/libraries.py
refresh()
¶
Refresh library data from API.
Fetches both staging and published library lists.
Returns:
| Name | Type | Description |
|---|---|---|
Libraries |
Libraries
|
Self for method chaining |
Source code in src/fabias/_fabric/items/libraries.py
replace(library_pattern, file_path, callback=None)
¶
Replace existing library with a new version.
Deletes all matching libraries from staging and uploads the new file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library_pattern
|
str
|
Regex pattern to match library names (e.g., "my_package") |
required |
file_path
|
str
|
Path to the new library file |
required |
callback
|
Optional[Callable[[str, Dict], None]]
|
Optional progress callback(action, details) |
None
|
Examples:
>>> libs.replace(
... "my_package",
... "/path/to/my_package-2.0.0-py3-none-any.whl",
... callback=lambda action, details: print(f"{action}: {details}")
... )
Source code in src/fabias/_fabric/items/libraries.py
upload(file_path)
¶
Upload a library file to staging.
Supports .whl, .py, .jar, and .tar.gz files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Path to the library file |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if upload succeeded |
Raises:
| Type | Description |
|---|---|
FabiasError
|
If file not found or upload fails |
Source code in src/fabias/_fabric/items/libraries.py
fabias.SparkSettings
¶
Mutable container for workspace Spark settings.
Fetch via workspace.spark.settings (lazy-loaded and cached). Mutate
properties in-place, then call :meth:commit to push all changes.
Attributes:
| Name | Type | Description |
|---|---|---|
log |
Enable automatic Spark run logging. |
|
highconcurrency |
Shared session settings. |
|
environment |
Default environment -- name and runtime version. |
|
jobs |
Job admission control -- reserve cores and queue timeout. |
|
pool |
Pool config -- default pool, starter pool, custom compute. |
Examples::
s = workspace.spark.settings
s.log = True
s.highconcurrency.interactive = True
s.environment = Environment("ML Env", "1.3")
s.pool.customcompute = True
s.pool.starter.nodes = 10
s.pool.starter.executors = 5
s.commit()
Source code in src/fabias/_fabric/spark.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | |
Functions¶
commit()
¶
Push all accumulated changes to the API, then re-sync from server.
Returns:
| Type | Description |
|---|---|
'SparkSettings'
|
self -- for optional chaining/inspection. |
Source code in src/fabias/_fabric/spark.py
fabias.Spark
¶
Manages Spark settings for a Microsoft Fabric workspace.
Accessed via workspace.spark. The settings property lazy-loads
and caches the :class:SparkSettings object.
Examples::
workspace.spark.settings.log = True
workspace.spark.settings.pool.customcompute = True
workspace.spark.settings.commit()
Source code in src/fabias/_fabric/spark.py
fabias.Git
¶
Manages Git integration for a Microsoft Fabric workspace.
Provides methods to: - Connect/disconnect workspace to/from Git repository - Initialize Git connections - Check Git sync status - Update workspace from Git (pull) - Commit workspace changes to Git (push) - Configure Git credentials
Examples:
>>> workspace = client.workspace()
>>> git = workspace.git
>>>
>>> # Connect to repository
>>> git.connect("https://github.com/org/repo", "main")
>>> git.initialize().wait()
>>>
>>> # Check status
>>> status = git.status()
>>> print(f"Changes: {len(status.changes)}")
>>>
>>> # Update from Git
>>> if status.has_changes:
... operation = git.pull()
... operation.wait()
Source code in src/fabias/_fabric/git.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 | |
Attributes¶
credentials
property
¶
Access Git credentials for this workspace.
Returns:
| Name | Type | Description |
|---|---|---|
GitCredentialsAccessor |
GitCredentialsAccessor
|
Accessor for getting and updating credentials |
Examples:
Get credentials:
Update credentials:
Functions¶
__init__(client, workspace_id)
¶
Initialize Git handler for a workspace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
FabricClient
|
Authenticated FabricClient |
required |
workspace_id
|
str
|
Workspace GUID |
required |
Source code in src/fabias/_fabric/git.py
commitAndPush(comment, items=None, head=None)
¶
Commit workspace changes to Git (push).
Initiates a long-running operation to commit changes from the workspace to the remote Git repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
comment
|
str
|
Commit message |
required |
items
|
Optional[List[GitItem]]
|
List of GitItem objects to commit. Typically obtained from git.status(). If None, commits all pending changes. |
None
|
head
|
Optional[str]
|
Workspace commit hash (uses current if not provided) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Operation |
AzResponse
|
Long-running operation for tracking progress |
Examples:
>>> # Commit all changes
>>> git.commitAndPush("Update reports")
>>>
>>> # Commit specific items
>>> status = git.status()
>>> workspace_items = status.workspaceChanges
>>> git.commitAndPush("Add new datasets", items=workspace_items)
Source code in src/fabias/_fabric/git.py
connect(repository_url, branch, directory='/', connection=None, provider_type=None)
¶
Connect workspace to a Git repository and branch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repository_url
|
str
|
Full Git repository URL (e.g., https://github.com/owner/repo) |
required |
branch
|
str
|
Branch name to connect to |
required |
directory
|
str
|
Directory path within repository (default: root "/") |
'/'
|
connection
|
Optional[Connection]
|
Optional Connection object for authenticated access (e.g., for private repos) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Git |
Git
|
Self for method chaining |
Examples:
>>> # Public repository
>>> git.connect(
... repository_url="https://github.com/myorg/myrepo",
... branch="main",
... directory="/fabric-workspace"
... )
>>> # Private repository with connection
>>> conn = fabric.connection("GIT-FLOW-SA")
>>> git.connect(
... repository_url="https://github.com/myorg/private-repo",
... branch="main",
... connection=conn
... )
Source code in src/fabias/_fabric/git.py
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 | |
connection()
¶
Get Git connection information for this workspace.
Returns:
| Name | Type | Description |
|---|---|---|
GitConnection |
GitConnection
|
Connection details with repository, branch, provider info |
Examples:
>>> git = workspace.git
>>> conn = git.connection()
>>> if conn.is_connected:
... print(f"Repo: {conn.repository}")
... print(f"Branch: {conn.branch}")
Source code in src/fabias/_fabric/git.py
disconnect()
¶
Disconnect workspace from Git repository.
Removes the Git connection from this workspace. Does not affect the remote repository or any files.
Returns:
| Name | Type | Description |
|---|---|---|
Git |
Git
|
Self for method chaining |
Examples:
Source code in src/fabias/_fabric/git.py
initialize(initialization_strategy=None)
¶
Initialize a Git connection for a workspace that's connected to Git.
This initializes the connection after calling connect(), preparing the workspace for sync operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
initialization_strategy
|
Optional[Union[InitializationStrategy, str]]
|
Strategy when content exists on both sides. Can be an InitializationStrategy enum or string: - None (default): No strategy defined - InitializationStrategy.PREFER_REMOTE or "PreferRemote": Prefer remote Git content - InitializationStrategy.PREFER_WORKSPACE or "PreferWorkspace": Prefer workspace content |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
AzResponse |
AzResponse
|
Response object (either immediate or long-running) For immediate operations (200 response), access via .data dict: - data['requiredAction']: Next action needed - data['remoteCommitHash']: Remote full SHA commit hash - data['workspaceHead']: Full SHA hash that workspace is synced to |
Examples:
>>> # Using enum (recommended - provides IntelliSense)
>>> from fabias.fabric.enums import InitializationStrategy
>>> git.connect(repo_url, "main")
>>> op = git.initialize(InitializationStrategy.PREFER_REMOTE)
>>> if not op.longRunning:
... print(f"Required action: {op.data.get('requiredAction')}")
Source code in src/fabias/_fabric/git.py
pull(conflict_resolution='PreferRemote', allow_override=True, head=None, remote_commit=None)
¶
Update the workspace from Git (pull).
Initiates a long-running operation to sync the workspace with the remote Git repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conflict_resolution
|
str
|
How to handle conflicts: - "PreferRemote": Use remote version (default) - "PreferWorkspace": Keep workspace version |
'PreferRemote'
|
allow_override
|
bool
|
Whether to allow overwriting workspace items |
True
|
head
|
Optional[str]
|
Workspace commit hash (uses current if not provided) |
None
|
remote_commit
|
Optional[str]
|
Remote commit to sync to (uses latest if not provided) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
AzResponse |
AzResponse
|
Long-running operation for tracking progress |
Examples:
>>> operation = git.pull()
>>> operation.wait(callback=lambda op: print(f"Progress: {op.percent}%"))
>>> print("Sync complete!")
Source code in src/fabias/_fabric/git.py
status(force_refresh=False)
¶
Get the current Git sync status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
force_refresh
|
bool
|
If True, always fetch from API. If False, may return cached status. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
GitStatus |
GitStatus
|
Current sync status with changes list |
Raises:
| Type | Description |
|---|---|
FabiasError
|
If Git credentials not configured or API fails |
Source code in src/fabias/_fabric/git.py
Enums¶
fabias.WorkspaceRole
¶
Bases: str, Enum
Workspace role assignment types.
Used when managing workspace role assignments.
Source code in src/fabias/_fabric/_shared/enums.py
fabias.ConnectionRole
¶
Bases: str, Enum
Connection role assignment types.
Used when managing connection role assignments.
Source code in src/fabias/_fabric/_shared/enums.py
fabias.ConnectivityType
¶
Bases: str, Enum
Connection connectivity type enumeration.
Specifies how a connection connects to data sources. Additional connectivity types may be added over time.
Attributes:
| Name | Type | Description |
|---|---|---|
SHAREABLE_CLOUD |
Connection through the cloud that can be shared |
|
PERSONAL_CLOUD |
Connection through the cloud that cannot be shared |
|
ON_PREMISES_GATEWAY |
Connection through an on-premises data gateway |
|
ON_PREMISES_GATEWAY_PERSONAL |
Connection through a personal on-premises data gateway |
|
VIRTUAL_NETWORK_GATEWAY |
Connection through a virtual network data gateway |
|
AUTOMATIC |
Connection through the cloud using implicit data connection (SSO scenarios) |
|
NONE |
Connection is not bound |
Source code in src/fabias/_fabric/_shared/enums.py
fabias.PrivacyLevel
¶
Bases: str, Enum
Connection privacy level enumeration.
Specifies the privacy level setting of a connection. Additional privacy levels may be added over time.
Attributes:
| Name | Type | Description |
|---|---|---|
NONE |
No privacy level configured |
|
PRIVATE |
Sensitive/confidential data, restricted to authorized users |
|
ORGANIZATIONAL |
Can fold into private and other organizational connections |
|
PUBLIC |
Files, internet, workbook data - visible to everyone |
Source code in src/fabias/_fabric/_shared/enums.py
fabias.SingleSignOnType
¶
Bases: str, Enum
Single sign-on type enumeration.
Specifies the SSO authentication method. Additional SSO types may be added over time.
Attributes:
| Name | Type | Description |
|---|---|---|
NONE |
No single sign-on |
|
KERBEROS |
Kerberos SSO |
|
MICROSOFT_ENTRA_ID |
Microsoft Entra ID SSO |
|
SAML |
Security Assertion Markup Language SSO |
|
KERBEROS_DIRECT_QUERY_AND_REFRESH |
Kerberos DirectQuery and Refresh SSO |
Source code in src/fabias/_fabric/_shared/enums.py
fabias.ConnectionEncryption
¶
Bases: str, Enum
Connection encryption type enumeration.
Specifies the encryption setting used during connection. Additional encryption values may be added over time.
Attributes:
| Name | Type | Description |
|---|---|---|
ENCRYPTED |
Connection uses encryption |
|
ANY |
Tries encrypted first, falls back to unencrypted |
|
NOT_ENCRYPTED |
Connection does not use encryption |
Source code in src/fabias/_fabric/_shared/enums.py
fabias.ItemType
¶
Bases: str, Enum
Workspace item type enumeration.
Specifies the type of item in a workspace. Additional item types may be added over time.
Attributes:
| Name | Type | Description |
|---|---|---|
DASHBOARD |
PowerBI dashboard |
|
REPORT |
PowerBI report |
|
SEMANTIC_MODEL |
PowerBI semantic model |
|
PAGINATED_REPORT |
PowerBI paginated report |
|
DATAMART |
PowerBI datamart |
|
LAKEHOUSE |
A lakehouse |
|
EVENTHOUSE |
An eventhouse |
|
ENVIRONMENT |
An environment |
|
KQL_DATABASE |
A KQL database |
|
KQL_QUERYSET |
A KQL queryset |
|
KQL_DASHBOARD |
A KQL dashboard |
|
DATA_PIPELINE |
A data pipeline |
|
NOTEBOOK |
A notebook |
|
SPARK_JOB_DEFINITION |
A spark job definition |
|
ML_EXPERIMENT |
A machine learning experiment |
|
ML_MODEL |
A machine learning model |
|
WAREHOUSE |
A warehouse |
|
EVENTSTREAM |
An eventstream |
|
SQL_ENDPOINT |
An SQL endpoint |
|
MIRRORED_WAREHOUSE |
A mirrored warehouse |
|
MIRRORED_DATABASE |
A mirrored database |
|
REFLEX |
A Reflex |
|
GRAPHQL_API |
An API for GraphQL item |
|
MOUNTED_DATA_FACTORY |
A MountedDataFactory |
|
SQL_DATABASE |
A SQLDatabase |
|
COPY_JOB |
A Copy job |
|
VARIABLE_LIBRARY |
A VariableLibrary |
|
DATAFLOW |
A Dataflow |
|
APACHE_AIRFLOW_JOB |
An ApacheAirflowJob |
|
WAREHOUSE_SNAPSHOT |
A Warehouse snapshot |
|
DIGITAL_TWIN_BUILDER |
A DigitalTwinBuilder |
|
DIGITAL_TWIN_BUILDER_FLOW |
A Digital Twin Builder Flow |
|
MIRRORED_AZURE_DATABRICKS_CATALOG |
A mirrored azure databricks catalog |
|
MAP |
A Map |
|
ANOMALY_DETECTOR |
An Anomaly Detector |
|
USER_DATA_FUNCTION |
A User Data Function |
|
GRAPH_MODEL |
A GraphModel |
|
GRAPH_QUERY_SET |
A Graph QuerySet |
|
SNOWFLAKE_DATABASE |
A Snowflake Database |
|
OPERATIONS_AGENT |
A OperationsAgent |
|
COSMOS_DB_DATABASE |
A Cosmos DB Database |
|
ONTOLOGY |
An Ontology |
|
EVENT_SCHEMA_SET |
An EventSchemaSet |
Source code in src/fabias/_fabric/_shared/enums.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | |
fabias.ItemAccess
¶
Bases: str, Enum
Item access permission enumeration.
Specifies individual access permissions that can be combined in lists. Use in List[ItemAccess] for members that can have multiple permissions.
Attributes:
| Name | Type | Description |
|---|---|---|
READ |
Item Access Read |
|
WRITE |
Item Access Write |
|
RESHARE |
Item Access Reshare |
|
EXPLORE |
Item Access Explore |
|
EXECUTE |
Item Access Execute |
|
READALL |
Item Access ReadAll |
Examples:
>>> # Single permission
>>> member = Member(memberType=MemberType.ENTRA, access=[ItemAccess.READ])
>>>
>>> # Multiple permissions
>>> member = Member(
... memberType=MemberType.ENTRA,
... access=[ItemAccess.READ, ItemAccess.WRITE, ItemAccess.EXECUTE]
... )
Source code in src/fabias/_fabric/_shared/enums.py
fabias.ReadWrite
¶
Bases: str, Enum
ReadWrite type enumeration.
Specifies the level of permissions to an item. Additional item types may be added over time.
Attributes:
| Name | Type | Description |
|---|---|---|
READ |
read-only access |
|
READWRITE |
Read and write access |
Source code in src/fabias/_fabric/_shared/enums.py
fabias.NotebookFormat
¶
Bases: str, Enum
Notebook format enumeration.
Specifies the format of a notebook. Additional formats may be added over time.
Attributes:
| Name | Type | Description |
|---|---|---|
IPYN |
Databricks notebook format |
|
GITSOURCE |
Fabric Git source format |
Source code in src/fabias/_fabric/_shared/enums.py
fabias.PoolType
¶
Bases: str, Enum
Spark pool type enumeration.
Identifies the type of Spark pool assigned as the default for a workspace.
Attributes:
| Name | Type | Description |
|---|---|---|
WORKSPACE |
Starter pool provisioned at the workspace level |
|
CAPACITY |
Custom pool provisioned at the capacity level |
Source code in src/fabias/_fabric/_shared/enums.py
fabias.GitProviderType
¶
Bases: str, Enum
Git provider type enumeration.
Used when connecting a workspace to a Git repository. Additional provider types may be added over time.
Attributes:
| Name | Type | Description |
|---|---|---|
AZURE_DEVOPS |
Azure DevOps provider |
|
GITHUB |
GitHub provider |
Source code in src/fabias/_fabric/_shared/enums.py
fabias.OperationStatus
¶
Bases: str, Enum
Long-running operation status enumeration.
Represents the current state of an operation. Additional statuses may be added over time.
Attributes:
| Name | Type | Description |
|---|---|---|
UNDEFINED |
Status is undefined |
|
NOT_STARTED |
Operation not started |
|
RUNNING |
Operation is running |
|
SUCCEEDED |
Operation completed successfully |
|
FAILED |
Operation failed |