msfabricpysdkcore 0.2.2__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/PKG-INFO +226 -24
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/README.md +223 -22
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/adminapi.py +114 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/coreapi.py +1216 -53
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/deployment_pipeline.py +203 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/domain.py +4 -1
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/eventstream.py +68 -0
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/folder.py +69 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/item.py +9 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/lakehouse.py +9 -1
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/otheritems.py +59 -40
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/tests/test_admin_tags.py +46 -0
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/tests/test_copy_jobs.py +60 -0
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/tests/test_dataflows.py +60 -0
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/tests/test_datapipelines.py +60 -0
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/tests/test_deployment_pipelinev2.py +135 -0
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/tests/test_eventstream_topology.py +82 -0
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/tests/test_folders.py +53 -0
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/tests/test_tags.py +28 -0
- msfabricpysdkcore-0.2.4/msfabricpysdkcore/tests/test_variable_libary.py +61 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/workspace.py +354 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore.egg-info/PKG-INFO +226 -24
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore.egg-info/SOURCES.txt +10 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/pyproject.toml +1 -1
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/setup.py +1 -1
- msfabricpysdkcore-0.2.2/msfabricpysdkcore/deployment_pipeline.py +0 -130
- msfabricpysdkcore-0.2.2/msfabricpysdkcore/tests/test_datapipelines.py +0 -45
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/LICENSE +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/__init__.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/admin_item.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/admin_workspace.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/auth.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/capacity.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/client.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/environment.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/fabric_azure_capacity.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/fabric_azure_client.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/job_instance.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/long_running_operation.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/onelakeshortcut.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/spark_custom_pool.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/__init__.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_admin_apis.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_connection.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_deployment_pipeline.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_domains.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_environments.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_evenhouses.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_evenstreams.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_external_data_shares.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_fabric_azure_client.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_gateways.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_git.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_graphqlapi.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_items.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_jobs.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_kql_dashboards.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_kql_queryset.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_kqldatabases.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_lakehouse.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_managed_private_endpoints.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_mirroreddatabases.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_ml_experiments.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_ml_models.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_mounted_adf.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_notebooks.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_one_lake_data_access_security.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_other_items.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_reflex.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_reports.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_semantic_model.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_shortcuts.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_spark.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_sparkjobdefinition.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_sqldatabases.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_warehouses.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/tests/test_workspaces_capacities.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/util/__init__.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore/util/logger.py +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore.egg-info/dependency_links.txt +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore.egg-info/requires.txt +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/msfabricpysdkcore.egg-info/top_level.txt +0 -0
- {msfabricpysdkcore-0.2.2 → msfabricpysdkcore-0.2.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: msfabricpysdkcore
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.4
|
4
4
|
Summary: A Python SDK for Microsoft Fabric
|
5
5
|
Author: Andreas Rederer
|
6
6
|
Project-URL: Homepage, https://github.com/DaSenf1860/ms-fabric-sdk-core
|
@@ -13,11 +13,12 @@ License-File: LICENSE
|
|
13
13
|
Requires-Dist: requests>=2.30.0
|
14
14
|
Requires-Dist: azure-identity>=1.15.0
|
15
15
|
Requires-Dist: msal>=1.28.0
|
16
|
+
Dynamic: license-file
|
16
17
|
Dynamic: requires-dist
|
17
18
|
|
18
19
|
# Python SDK for Microsoft Fabric
|
19
20
|
|
20
|
-
This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs (v1) of Fabric*. It supports all Fabric REST APIs as well as Azure Resource Management APIs for Fabric (as of
|
21
|
+
This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs (v1) of Fabric*. It supports all Fabric REST APIs as well as Azure Resource Management APIs for Fabric (as of March 06, 2025).
|
21
22
|
|
22
23
|

|
23
24
|
|
@@ -46,7 +47,9 @@ Currently it supports all Core APIs, Admin APIs, all item specific CRUD APIs and
|
|
46
47
|
- [Capacities](#working-with-capacities)
|
47
48
|
- [Connections](#connections)
|
48
49
|
- [Deployment Pipelines](#deployment-pipelines)
|
49
|
-
- [External Data Shares](#external-data-shares)
|
50
|
+
- [External Data Shares Provider](#external-data-shares-provider)
|
51
|
+
- [External Data Shares Recipient](#external-data-shares-recipient)
|
52
|
+
- [Folders](#folders)
|
50
53
|
- [Gateways](#gateways)
|
51
54
|
- [Git](#working-with-git)
|
52
55
|
- [Items](#working-with-items)
|
@@ -55,12 +58,14 @@ Currently it supports all Core APIs, Admin APIs, all item specific CRUD APIs and
|
|
55
58
|
- [Long Running Operations](#long-running-operations)
|
56
59
|
- [OneLakeDataAccessSecurity](#one-lake-data-access-security)
|
57
60
|
- [OneLakeShortcuts](#working-with-one-lake-shortcuts)
|
61
|
+
- [Tags](#tags)
|
58
62
|
- [Workspaces](#working-with-workspaces)
|
59
63
|
- Admin APIs
|
60
64
|
- [Domains](#admin-api-for-domains)
|
61
65
|
- [External Data Shares](#admin-api-for-external-data-shares)
|
62
66
|
- [Items](#admin-api-for-items)
|
63
67
|
- [Labels](#admin-api-for-labels)
|
68
|
+
- [Tags](#admin-api-for-tags)
|
64
69
|
- [Tenants](#admin-api-for-tenants)
|
65
70
|
- [Users](#admin-api-for-users)
|
66
71
|
- [Workspaces](#admin-api-for-workspaces)
|
@@ -118,6 +123,8 @@ fc = FabricClientCore(tenant_id = "tenant_id",
|
|
118
123
|
|
119
124
|
token = fc.get_token()
|
120
125
|
```
|
126
|
+
|
127
|
+
|
121
128
|
### Working with workspaces
|
122
129
|
|
123
130
|
```python
|
@@ -314,43 +321,112 @@ role_assi = fc.update_connection_role_assignment(connection_id="id",
|
|
314
321
|
### Deployment Pipelines
|
315
322
|
|
316
323
|
```python
|
324
|
+
from msfabricpysdkcore import FabricClientCore
|
317
325
|
|
326
|
+
fcc = FabricClientCore()
|
327
|
+
workspace_id = "72dasdfasdf56"
|
328
|
+
|
329
|
+
user_id = "e05sadfasfd23"
|
330
|
+
capacity_id = "9e7easdfasdf2a00"
|
331
|
+
|
332
|
+
prod_workspace = fcc.create_workspace("prodworkspace")
|
333
|
+
prod_workspace.assign_to_capacity(capacity_id)
|
334
|
+
|
335
|
+
stages = [
|
336
|
+
{
|
337
|
+
"displayName": "Development",
|
338
|
+
"description": "Development stage description",
|
339
|
+
"isPublic": False
|
340
|
+
},
|
341
|
+
{
|
342
|
+
"displayName": "Production",
|
343
|
+
"description": "Production stage description",
|
344
|
+
"isPublic":True
|
345
|
+
}
|
346
|
+
]
|
318
347
|
|
319
|
-
#
|
348
|
+
# Create deployment pipeline
|
349
|
+
pipe =fcc.create_deployment_pipeline(display_name="sdktestpipeline",
|
350
|
+
description="Test Deployment Pipeline Description",
|
351
|
+
stages=stages)
|
352
|
+
pipe_id = pipe.id
|
320
353
|
|
321
|
-
|
354
|
+
for stage in pipe.stages:
|
355
|
+
if stage["displayName"] == "Development":
|
356
|
+
dev_stage = stage
|
357
|
+
else:
|
358
|
+
prod_stage = stage
|
322
359
|
|
323
|
-
|
324
|
-
|
360
|
+
# Get deployment pipeline
|
361
|
+
stage = fcc.get_deployment_pipeline_stage(deployment_pipeline_id=pipe_id,
|
362
|
+
stage_id=dev_stage["id"])
|
325
363
|
|
326
|
-
#
|
327
|
-
|
364
|
+
# Assign workspace to stage
|
365
|
+
resp = fcc.assign_workspace_to_stage(deployment_pipeline_id=pipe_id,
|
366
|
+
stage_id=dev_stage["id"],
|
367
|
+
workspace_id=workspace_id)
|
328
368
|
|
329
369
|
|
330
|
-
|
331
|
-
|
370
|
+
resp = fcc.assign_workspace_to_stage(deployment_pipeline_id=pipe_id,
|
371
|
+
stage_id=prod_stage["id"],
|
372
|
+
workspace_id=prod_workspace.id)
|
332
373
|
|
333
|
-
|
374
|
+
# Add deployment pipeline role assignment
|
375
|
+
principal = {
|
376
|
+
"id": user_id,
|
377
|
+
"type": "User"
|
378
|
+
}
|
334
379
|
|
335
|
-
|
336
|
-
prod_stage = [stage for stage in stages if stage.display_name == "Production"][0]
|
380
|
+
resp = fcc.add_deployment_pipeline_role_assignment(deployment_pipeline_id=pipe_id,principal=principal, role="Admin")
|
337
381
|
|
338
|
-
#
|
339
|
-
|
382
|
+
# List deployment pipeline role assignments
|
383
|
+
roles = fcc.list_deployment_pipeline_role_assignments(deployment_pipeline_id=pipe_id)
|
340
384
|
|
385
|
+
# Delete deployment pipeline role assignment
|
386
|
+
resp = fcc.delete_deployment_pipeline_role_assignment(deployment_pipeline_id=pipe_id, principal_id=user_id)
|
341
387
|
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
"itemType": item["itemType"]}
|
346
|
-
items = [item]
|
388
|
+
# List deployment pipelines
|
389
|
+
pipes = fcc.list_deployment_pipelines(with_details=False)
|
390
|
+
sdk_pipes = [pipe for pipe in pipes if "sdk" in pipe["displayName"]]
|
347
391
|
|
348
392
|
# Deploy stage content
|
349
|
-
|
393
|
+
resp = fcc.deploy_stage_content(deployment_pipeline_id=pipe_id,
|
394
|
+
source_stage_id=dev_stage["id"],
|
395
|
+
target_stage_id=prod_stage["id"], wait_for_completion=False)
|
396
|
+
|
397
|
+
# List deployment pipeline operations
|
398
|
+
ops = fcc.list_deployment_pipeline_operations(deployment_pipeline_id=pipe_id)
|
399
|
+
|
400
|
+
# Get deployment pipeline operation
|
401
|
+
ops = fcc.get_deployment_pipeline_operation(deployment_pipeline_id=pipe_id, operation_id=ops[0]["id"])
|
350
402
|
|
403
|
+
# List deployment pipeline stages
|
404
|
+
stages = fcc.list_deployment_pipeline_stages(deployment_pipeline_id=pipe_id)
|
405
|
+
|
406
|
+
# List deployment pipeline stage items
|
407
|
+
items = fcc.list_deployment_pipeline_stage_items(deployment_pipeline_id=pipe_id, stage_id=dev_stage["id"])
|
408
|
+
|
409
|
+
# Update deployment pipeline
|
410
|
+
updated_pipe = fcc.update_deployment_pipeline(deployment_pipeline_id=pipe.id, display_name="sdknewname", description="newdescription")
|
411
|
+
|
412
|
+
# Get deployment pipeline
|
413
|
+
pipe = fcc.get_deployment_pipeline(pipe_id)
|
414
|
+
|
415
|
+
# Update deployment pipeline stage
|
416
|
+
updated_stage = fcc.update_deployment_pipeline_stage(deployment_pipeline_id=pipe_id, stage_id=prod_stage["id"],
|
417
|
+
display_name="newname", description="newdescription")
|
418
|
+
|
419
|
+
# Get deployment pipeline stage
|
420
|
+
stage = fcc.get_deployment_pipeline_stage(deployment_pipeline_id=pipe_id, stage_id=prod_stage["id"])
|
421
|
+
|
422
|
+
# Unassign workspace from stage
|
423
|
+
resp = fcc.unassign_workspace_from_stage(deployment_pipeline_id=pipe_id,stage_id=prod_stage["id"])
|
424
|
+
|
425
|
+
# Delete deployment pipeline
|
426
|
+
resp = fcc.delete_deployment_pipeline(deployment_pipeline_id=pipe_id)
|
351
427
|
```
|
352
428
|
|
353
|
-
### External Data Shares
|
429
|
+
### External Data Shares Provider
|
354
430
|
|
355
431
|
```python
|
356
432
|
from msfabricpysdkcore.coreapi import FabricClientCore
|
@@ -386,6 +462,36 @@ response_code = fc.revoke_external_data_share(workspace_id, item_id, data_share[
|
|
386
462
|
|
387
463
|
```
|
388
464
|
|
465
|
+
### External Data Shares Recipient
|
466
|
+
|
467
|
+
```python
|
468
|
+
from msfabricpysdkcore.coreapi import FabricClientCore
|
469
|
+
fcc = FabricClientCore()
|
470
|
+
|
471
|
+
# Accept external data share invitation
|
472
|
+
invitation_id = "adfasdfsd"
|
473
|
+
workspace_id = "asdfsdf"
|
474
|
+
item_id = "asdfsdf"
|
475
|
+
provider_tenant_id = "asdfsdf"
|
476
|
+
payload = {
|
477
|
+
"payloadType": "ShortcutCreation",
|
478
|
+
"path": "Files/DataFromContoso",
|
479
|
+
"createShortcutRequests": [
|
480
|
+
{
|
481
|
+
"pathId": "5c95314c-ef86-4663-9f1e-dee186f38715",
|
482
|
+
"shortcutName": "Shortcut_To_Contoso_Sales_2023"
|
483
|
+
},
|
484
|
+
{
|
485
|
+
"pathId": "6c95314c-ef86-4663-9f1e-dee186f38716",
|
486
|
+
"shortcutName": "Shortcut_To_Contoso_Sales_2024"
|
487
|
+
}
|
488
|
+
]
|
489
|
+
}
|
490
|
+
obj = fcc.accept_external_data_share_invitation(invitation_id=invitation_id, item_id=item_id,payload=payload, provider_tenant_id=provider_tenant_id,workspace_id=workspace_id):
|
491
|
+
|
492
|
+
# Get external data share invitation details
|
493
|
+
details = fcc.get_external_data_share_invitation(invitation_id=invitation_id, provider_tenant_id=provider_tenant_id)
|
494
|
+
```
|
389
495
|
|
390
496
|
### Working with items
|
391
497
|
|
@@ -433,6 +539,36 @@ ws.delete_item(item_id="item_id")
|
|
433
539
|
# or
|
434
540
|
item.delete()
|
435
541
|
|
542
|
+
```
|
543
|
+
|
544
|
+
### Folders
|
545
|
+
```python
|
546
|
+
from msfabricpysdkcore import FabricClientCore
|
547
|
+
fcc = FabricClientCore()
|
548
|
+
|
549
|
+
|
550
|
+
workspace_id = "asdfasfd"
|
551
|
+
folder_id = "asdfasdff"
|
552
|
+
|
553
|
+
# Create a folder
|
554
|
+
folder = fcc.create_folder(workspace_id=workspace_id, display_name="sdk_sub_folder", parent_folder_id=folder_id)
|
555
|
+
|
556
|
+
# Get a folder
|
557
|
+
folder_ = fcc.get_folder(workspace_id=workspace_id, folder_id=folder.id)
|
558
|
+
|
559
|
+
# List folders
|
560
|
+
folders = fcc.list_folders(workspace_id=workspace_id)
|
561
|
+
|
562
|
+
# Update a folder
|
563
|
+
folder = fcc.update_folder(workspace_id=workspace_id, folder_id=folder.id, display_name="sdk_sub_folder_updated")
|
564
|
+
|
565
|
+
# Move a folder
|
566
|
+
folder = fcc.move_folder(workspace_id=workspace_id, folder_id=folder.id)
|
567
|
+
|
568
|
+
# Delete a folder
|
569
|
+
fcc.delete_folder(workspace_id=workspace_id, folder_id=folder.id)
|
570
|
+
|
571
|
+
|
436
572
|
```
|
437
573
|
|
438
574
|
### Gateways
|
@@ -640,6 +776,24 @@ fc.reset_shortcut_cache(workspace_id="23232", wait_for_completion = False)
|
|
640
776
|
|
641
777
|
```
|
642
778
|
|
779
|
+
### Tags
|
780
|
+
|
781
|
+
```python
|
782
|
+
from msfabricpysdkcore import FabricClientCore
|
783
|
+
fcc = FabricClientCore()
|
784
|
+
|
785
|
+
# List tags
|
786
|
+
tags = fcc.list_tags()
|
787
|
+
|
788
|
+
tag_ids = [tag["id"] for tag in tags]
|
789
|
+
|
790
|
+
# Apply tags
|
791
|
+
resp = fcc.apply_tags(workspace_id = "adsfsdf", item_id = "a9e59ec1-524b-49b1-a185-37e47dc0ceb9", tags = tag_ids)
|
792
|
+
|
793
|
+
# Unapply tags
|
794
|
+
resp = fcc.unapply_tags(workspace_id = "adsfsdf", item_id = "a9e59ec1-524b-49b1-a185-37e47dc0ceb9", tags = tag_ids)
|
795
|
+
|
796
|
+
```
|
643
797
|
|
644
798
|
### Working with job scheduler
|
645
799
|
|
@@ -821,6 +975,54 @@ access_entities = fca.list_access_entities(user_id, type="Notebook")
|
|
821
975
|
|
822
976
|
```
|
823
977
|
|
978
|
+
### Admin API for Sharing Links
|
979
|
+
|
980
|
+
```python
|
981
|
+
from msfabricpysdkcore import FabricClientAdmin
|
982
|
+
fca = FabricClientAdmin()
|
983
|
+
|
984
|
+
items = [
|
985
|
+
{
|
986
|
+
"id": "fe472f5e-636e-4c10-a1c6-7e9edc0b542a",
|
987
|
+
"type": "Report"
|
988
|
+
},
|
989
|
+
{
|
990
|
+
"id": "476fcafe-b514-495d-b13f-ca9a4f0b1d8b",
|
991
|
+
"type": "Report"
|
992
|
+
}]
|
993
|
+
|
994
|
+
# Bulk remove sharing links
|
995
|
+
fca.bulk_remove_sharing_links(items = items, sharing_link_type = "OrgLink")
|
996
|
+
|
997
|
+
# Remove all sharing links
|
998
|
+
fca.remove_all_sharing_links(sharing_link_type = "OrgLink")
|
999
|
+
```
|
1000
|
+
|
1001
|
+
### Admin API for Tags
|
1002
|
+
|
1003
|
+
```python
|
1004
|
+
|
1005
|
+
from msfabricpysdkcore import FabricClientAdmin
|
1006
|
+
|
1007
|
+
fca = FabricClientAdmin()
|
1008
|
+
|
1009
|
+
# Bulk create tags
|
1010
|
+
new_tags = [{"displayName": "sdk_tag_temp"}]
|
1011
|
+
resp = fca.bulk_create_tags(create_tags_request=new_tags)
|
1012
|
+
|
1013
|
+
# Delete tag
|
1014
|
+
fca.delete_tag(tag_id="adsfasdf")
|
1015
|
+
|
1016
|
+
# List tags
|
1017
|
+
tag_list = fca.list_tags()
|
1018
|
+
|
1019
|
+
# Update Tag
|
1020
|
+
updated_tag = fca.update_tag(tag_id="adsfasdf", display_name="sdk_tag_updated")
|
1021
|
+
|
1022
|
+
|
1023
|
+
```
|
1024
|
+
|
1025
|
+
|
824
1026
|
### Admin API for Tenants
|
825
1027
|
|
826
1028
|
```python
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Python SDK for Microsoft Fabric
|
2
2
|
|
3
|
-
This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs (v1) of Fabric*. It supports all Fabric REST APIs as well as Azure Resource Management APIs for Fabric (as of
|
3
|
+
This is a Python SDK for Microsoft Fabric. It is a wrapper around the REST APIs (v1) of Fabric*. It supports all Fabric REST APIs as well as Azure Resource Management APIs for Fabric (as of March 06, 2025).
|
4
4
|
|
5
5
|

|
6
6
|
|
@@ -29,7 +29,9 @@ Currently it supports all Core APIs, Admin APIs, all item specific CRUD APIs and
|
|
29
29
|
- [Capacities](#working-with-capacities)
|
30
30
|
- [Connections](#connections)
|
31
31
|
- [Deployment Pipelines](#deployment-pipelines)
|
32
|
-
- [External Data Shares](#external-data-shares)
|
32
|
+
- [External Data Shares Provider](#external-data-shares-provider)
|
33
|
+
- [External Data Shares Recipient](#external-data-shares-recipient)
|
34
|
+
- [Folders](#folders)
|
33
35
|
- [Gateways](#gateways)
|
34
36
|
- [Git](#working-with-git)
|
35
37
|
- [Items](#working-with-items)
|
@@ -38,12 +40,14 @@ Currently it supports all Core APIs, Admin APIs, all item specific CRUD APIs and
|
|
38
40
|
- [Long Running Operations](#long-running-operations)
|
39
41
|
- [OneLakeDataAccessSecurity](#one-lake-data-access-security)
|
40
42
|
- [OneLakeShortcuts](#working-with-one-lake-shortcuts)
|
43
|
+
- [Tags](#tags)
|
41
44
|
- [Workspaces](#working-with-workspaces)
|
42
45
|
- Admin APIs
|
43
46
|
- [Domains](#admin-api-for-domains)
|
44
47
|
- [External Data Shares](#admin-api-for-external-data-shares)
|
45
48
|
- [Items](#admin-api-for-items)
|
46
49
|
- [Labels](#admin-api-for-labels)
|
50
|
+
- [Tags](#admin-api-for-tags)
|
47
51
|
- [Tenants](#admin-api-for-tenants)
|
48
52
|
- [Users](#admin-api-for-users)
|
49
53
|
- [Workspaces](#admin-api-for-workspaces)
|
@@ -101,6 +105,8 @@ fc = FabricClientCore(tenant_id = "tenant_id",
|
|
101
105
|
|
102
106
|
token = fc.get_token()
|
103
107
|
```
|
108
|
+
|
109
|
+
|
104
110
|
### Working with workspaces
|
105
111
|
|
106
112
|
```python
|
@@ -297,43 +303,112 @@ role_assi = fc.update_connection_role_assignment(connection_id="id",
|
|
297
303
|
### Deployment Pipelines
|
298
304
|
|
299
305
|
```python
|
306
|
+
from msfabricpysdkcore import FabricClientCore
|
300
307
|
|
308
|
+
fcc = FabricClientCore()
|
309
|
+
workspace_id = "72dasdfasdf56"
|
310
|
+
|
311
|
+
user_id = "e05sadfasfd23"
|
312
|
+
capacity_id = "9e7easdfasdf2a00"
|
313
|
+
|
314
|
+
prod_workspace = fcc.create_workspace("prodworkspace")
|
315
|
+
prod_workspace.assign_to_capacity(capacity_id)
|
316
|
+
|
317
|
+
stages = [
|
318
|
+
{
|
319
|
+
"displayName": "Development",
|
320
|
+
"description": "Development stage description",
|
321
|
+
"isPublic": False
|
322
|
+
},
|
323
|
+
{
|
324
|
+
"displayName": "Production",
|
325
|
+
"description": "Production stage description",
|
326
|
+
"isPublic":True
|
327
|
+
}
|
328
|
+
]
|
301
329
|
|
302
|
-
#
|
330
|
+
# Create deployment pipeline
|
331
|
+
pipe =fcc.create_deployment_pipeline(display_name="sdktestpipeline",
|
332
|
+
description="Test Deployment Pipeline Description",
|
333
|
+
stages=stages)
|
334
|
+
pipe_id = pipe.id
|
303
335
|
|
304
|
-
|
336
|
+
for stage in pipe.stages:
|
337
|
+
if stage["displayName"] == "Development":
|
338
|
+
dev_stage = stage
|
339
|
+
else:
|
340
|
+
prod_stage = stage
|
305
341
|
|
306
|
-
|
307
|
-
|
342
|
+
# Get deployment pipeline
|
343
|
+
stage = fcc.get_deployment_pipeline_stage(deployment_pipeline_id=pipe_id,
|
344
|
+
stage_id=dev_stage["id"])
|
308
345
|
|
309
|
-
#
|
310
|
-
|
346
|
+
# Assign workspace to stage
|
347
|
+
resp = fcc.assign_workspace_to_stage(deployment_pipeline_id=pipe_id,
|
348
|
+
stage_id=dev_stage["id"],
|
349
|
+
workspace_id=workspace_id)
|
311
350
|
|
312
351
|
|
313
|
-
|
314
|
-
|
352
|
+
resp = fcc.assign_workspace_to_stage(deployment_pipeline_id=pipe_id,
|
353
|
+
stage_id=prod_stage["id"],
|
354
|
+
workspace_id=prod_workspace.id)
|
315
355
|
|
316
|
-
|
356
|
+
# Add deployment pipeline role assignment
|
357
|
+
principal = {
|
358
|
+
"id": user_id,
|
359
|
+
"type": "User"
|
360
|
+
}
|
317
361
|
|
318
|
-
|
319
|
-
prod_stage = [stage for stage in stages if stage.display_name == "Production"][0]
|
362
|
+
resp = fcc.add_deployment_pipeline_role_assignment(deployment_pipeline_id=pipe_id,principal=principal, role="Admin")
|
320
363
|
|
321
|
-
#
|
322
|
-
|
364
|
+
# List deployment pipeline role assignments
|
365
|
+
roles = fcc.list_deployment_pipeline_role_assignments(deployment_pipeline_id=pipe_id)
|
323
366
|
|
367
|
+
# Delete deployment pipeline role assignment
|
368
|
+
resp = fcc.delete_deployment_pipeline_role_assignment(deployment_pipeline_id=pipe_id, principal_id=user_id)
|
324
369
|
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
"itemType": item["itemType"]}
|
329
|
-
items = [item]
|
370
|
+
# List deployment pipelines
|
371
|
+
pipes = fcc.list_deployment_pipelines(with_details=False)
|
372
|
+
sdk_pipes = [pipe for pipe in pipes if "sdk" in pipe["displayName"]]
|
330
373
|
|
331
374
|
# Deploy stage content
|
332
|
-
|
375
|
+
resp = fcc.deploy_stage_content(deployment_pipeline_id=pipe_id,
|
376
|
+
source_stage_id=dev_stage["id"],
|
377
|
+
target_stage_id=prod_stage["id"], wait_for_completion=False)
|
378
|
+
|
379
|
+
# List deployment pipeline operations
|
380
|
+
ops = fcc.list_deployment_pipeline_operations(deployment_pipeline_id=pipe_id)
|
381
|
+
|
382
|
+
# Get deployment pipeline operation
|
383
|
+
ops = fcc.get_deployment_pipeline_operation(deployment_pipeline_id=pipe_id, operation_id=ops[0]["id"])
|
333
384
|
|
385
|
+
# List deployment pipeline stages
|
386
|
+
stages = fcc.list_deployment_pipeline_stages(deployment_pipeline_id=pipe_id)
|
387
|
+
|
388
|
+
# List deployment pipeline stage items
|
389
|
+
items = fcc.list_deployment_pipeline_stage_items(deployment_pipeline_id=pipe_id, stage_id=dev_stage["id"])
|
390
|
+
|
391
|
+
# Update deployment pipeline
|
392
|
+
updated_pipe = fcc.update_deployment_pipeline(deployment_pipeline_id=pipe.id, display_name="sdknewname", description="newdescription")
|
393
|
+
|
394
|
+
# Get deployment pipeline
|
395
|
+
pipe = fcc.get_deployment_pipeline(pipe_id)
|
396
|
+
|
397
|
+
# Update deployment pipeline stage
|
398
|
+
updated_stage = fcc.update_deployment_pipeline_stage(deployment_pipeline_id=pipe_id, stage_id=prod_stage["id"],
|
399
|
+
display_name="newname", description="newdescription")
|
400
|
+
|
401
|
+
# Get deployment pipeline stage
|
402
|
+
stage = fcc.get_deployment_pipeline_stage(deployment_pipeline_id=pipe_id, stage_id=prod_stage["id"])
|
403
|
+
|
404
|
+
# Unassign workspace from stage
|
405
|
+
resp = fcc.unassign_workspace_from_stage(deployment_pipeline_id=pipe_id,stage_id=prod_stage["id"])
|
406
|
+
|
407
|
+
# Delete deployment pipeline
|
408
|
+
resp = fcc.delete_deployment_pipeline(deployment_pipeline_id=pipe_id)
|
334
409
|
```
|
335
410
|
|
336
|
-
### External Data Shares
|
411
|
+
### External Data Shares Provider
|
337
412
|
|
338
413
|
```python
|
339
414
|
from msfabricpysdkcore.coreapi import FabricClientCore
|
@@ -369,6 +444,36 @@ response_code = fc.revoke_external_data_share(workspace_id, item_id, data_share[
|
|
369
444
|
|
370
445
|
```
|
371
446
|
|
447
|
+
### External Data Shares Recipient
|
448
|
+
|
449
|
+
```python
|
450
|
+
from msfabricpysdkcore.coreapi import FabricClientCore
|
451
|
+
fcc = FabricClientCore()
|
452
|
+
|
453
|
+
# Accept external data share invitation
|
454
|
+
invitation_id = "adfasdfsd"
|
455
|
+
workspace_id = "asdfsdf"
|
456
|
+
item_id = "asdfsdf"
|
457
|
+
provider_tenant_id = "asdfsdf"
|
458
|
+
payload = {
|
459
|
+
"payloadType": "ShortcutCreation",
|
460
|
+
"path": "Files/DataFromContoso",
|
461
|
+
"createShortcutRequests": [
|
462
|
+
{
|
463
|
+
"pathId": "5c95314c-ef86-4663-9f1e-dee186f38715",
|
464
|
+
"shortcutName": "Shortcut_To_Contoso_Sales_2023"
|
465
|
+
},
|
466
|
+
{
|
467
|
+
"pathId": "6c95314c-ef86-4663-9f1e-dee186f38716",
|
468
|
+
"shortcutName": "Shortcut_To_Contoso_Sales_2024"
|
469
|
+
}
|
470
|
+
]
|
471
|
+
}
|
472
|
+
obj = fcc.accept_external_data_share_invitation(invitation_id=invitation_id, item_id=item_id,payload=payload, provider_tenant_id=provider_tenant_id,workspace_id=workspace_id):
|
473
|
+
|
474
|
+
# Get external data share invitation details
|
475
|
+
details = fcc.get_external_data_share_invitation(invitation_id=invitation_id, provider_tenant_id=provider_tenant_id)
|
476
|
+
```
|
372
477
|
|
373
478
|
### Working with items
|
374
479
|
|
@@ -416,6 +521,36 @@ ws.delete_item(item_id="item_id")
|
|
416
521
|
# or
|
417
522
|
item.delete()
|
418
523
|
|
524
|
+
```
|
525
|
+
|
526
|
+
### Folders
|
527
|
+
```python
|
528
|
+
from msfabricpysdkcore import FabricClientCore
|
529
|
+
fcc = FabricClientCore()
|
530
|
+
|
531
|
+
|
532
|
+
workspace_id = "asdfasfd"
|
533
|
+
folder_id = "asdfasdff"
|
534
|
+
|
535
|
+
# Create a folder
|
536
|
+
folder = fcc.create_folder(workspace_id=workspace_id, display_name="sdk_sub_folder", parent_folder_id=folder_id)
|
537
|
+
|
538
|
+
# Get a folder
|
539
|
+
folder_ = fcc.get_folder(workspace_id=workspace_id, folder_id=folder.id)
|
540
|
+
|
541
|
+
# List folders
|
542
|
+
folders = fcc.list_folders(workspace_id=workspace_id)
|
543
|
+
|
544
|
+
# Update a folder
|
545
|
+
folder = fcc.update_folder(workspace_id=workspace_id, folder_id=folder.id, display_name="sdk_sub_folder_updated")
|
546
|
+
|
547
|
+
# Move a folder
|
548
|
+
folder = fcc.move_folder(workspace_id=workspace_id, folder_id=folder.id)
|
549
|
+
|
550
|
+
# Delete a folder
|
551
|
+
fcc.delete_folder(workspace_id=workspace_id, folder_id=folder.id)
|
552
|
+
|
553
|
+
|
419
554
|
```
|
420
555
|
|
421
556
|
### Gateways
|
@@ -623,6 +758,24 @@ fc.reset_shortcut_cache(workspace_id="23232", wait_for_completion = False)
|
|
623
758
|
|
624
759
|
```
|
625
760
|
|
761
|
+
### Tags
|
762
|
+
|
763
|
+
```python
|
764
|
+
from msfabricpysdkcore import FabricClientCore
|
765
|
+
fcc = FabricClientCore()
|
766
|
+
|
767
|
+
# List tags
|
768
|
+
tags = fcc.list_tags()
|
769
|
+
|
770
|
+
tag_ids = [tag["id"] for tag in tags]
|
771
|
+
|
772
|
+
# Apply tags
|
773
|
+
resp = fcc.apply_tags(workspace_id = "adsfsdf", item_id = "a9e59ec1-524b-49b1-a185-37e47dc0ceb9", tags = tag_ids)
|
774
|
+
|
775
|
+
# Unapply tags
|
776
|
+
resp = fcc.unapply_tags(workspace_id = "adsfsdf", item_id = "a9e59ec1-524b-49b1-a185-37e47dc0ceb9", tags = tag_ids)
|
777
|
+
|
778
|
+
```
|
626
779
|
|
627
780
|
### Working with job scheduler
|
628
781
|
|
@@ -804,6 +957,54 @@ access_entities = fca.list_access_entities(user_id, type="Notebook")
|
|
804
957
|
|
805
958
|
```
|
806
959
|
|
960
|
+
### Admin API for Sharing Links
|
961
|
+
|
962
|
+
```python
|
963
|
+
from msfabricpysdkcore import FabricClientAdmin
|
964
|
+
fca = FabricClientAdmin()
|
965
|
+
|
966
|
+
items = [
|
967
|
+
{
|
968
|
+
"id": "fe472f5e-636e-4c10-a1c6-7e9edc0b542a",
|
969
|
+
"type": "Report"
|
970
|
+
},
|
971
|
+
{
|
972
|
+
"id": "476fcafe-b514-495d-b13f-ca9a4f0b1d8b",
|
973
|
+
"type": "Report"
|
974
|
+
}]
|
975
|
+
|
976
|
+
# Bulk remove sharing links
|
977
|
+
fca.bulk_remove_sharing_links(items = items, sharing_link_type = "OrgLink")
|
978
|
+
|
979
|
+
# Remove all sharing links
|
980
|
+
fca.remove_all_sharing_links(sharing_link_type = "OrgLink")
|
981
|
+
```
|
982
|
+
|
983
|
+
### Admin API for Tags
|
984
|
+
|
985
|
+
```python
|
986
|
+
|
987
|
+
from msfabricpysdkcore import FabricClientAdmin
|
988
|
+
|
989
|
+
fca = FabricClientAdmin()
|
990
|
+
|
991
|
+
# Bulk create tags
|
992
|
+
new_tags = [{"displayName": "sdk_tag_temp"}]
|
993
|
+
resp = fca.bulk_create_tags(create_tags_request=new_tags)
|
994
|
+
|
995
|
+
# Delete tag
|
996
|
+
fca.delete_tag(tag_id="adsfasdf")
|
997
|
+
|
998
|
+
# List tags
|
999
|
+
tag_list = fca.list_tags()
|
1000
|
+
|
1001
|
+
# Update Tag
|
1002
|
+
updated_tag = fca.update_tag(tag_id="adsfasdf", display_name="sdk_tag_updated")
|
1003
|
+
|
1004
|
+
|
1005
|
+
```
|
1006
|
+
|
1007
|
+
|
807
1008
|
### Admin API for Tenants
|
808
1009
|
|
809
1010
|
```python
|