msfabricpysdkcore 0.0.7__tar.gz → 0.0.8__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.0.7 → msfabricpysdkcore-0.0.8}/PKG-INFO +1 -1
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/auth.py +18 -2
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/client.py +8 -5
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/tests/test_items_incl_lakehouse.py +2 -2
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore.egg-info/PKG-INFO +1 -1
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/pyproject.toml +1 -1
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/setup.py +1 -1
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/LICENSE +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/README.md +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/__init__.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/admin_item.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/admin_workspace.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/adminapi.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/capacity.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/coreapi.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/domain.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/item.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/job_instance.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/lakehouse.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/long_running_operation.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/onelakeshortcut.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/otheritems.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/tests/__init__.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/tests/test_admin_apis.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/tests/test_domains.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/tests/test_git.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/tests/test_jobs.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/tests/test_shortcuts.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/tests/test_workspaces_capacities.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/workspace.py +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore.egg-info/SOURCES.txt +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore.egg-info/dependency_links.txt +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore.egg-info/requires.txt +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore.egg-info/top_level.txt +0 -0
- {msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/setup.cfg +0 -0
@@ -1,7 +1,10 @@
|
|
1
1
|
import requests
|
2
2
|
from abc import abstractmethod
|
3
3
|
from azure.identity import AzureCliCredential
|
4
|
-
|
4
|
+
try:
|
5
|
+
from notebookutils import mssparkutils
|
6
|
+
except ImportError:
|
7
|
+
pass
|
5
8
|
class FabricAuth():
|
6
9
|
"""FabricAuth class to interact with Entra ID"""
|
7
10
|
|
@@ -58,4 +61,17 @@ class FabricServicePrincipal(FabricAuth):
|
|
58
61
|
response = requests.post(url, data=payload)
|
59
62
|
access_token = response.json().get('access_token')
|
60
63
|
return access_token
|
61
|
-
|
64
|
+
|
65
|
+
class FabricSparkUtilsAuthentication(FabricAuth):
|
66
|
+
"""FabricSparkUtilsAuthentication class to interact with Entra ID"""
|
67
|
+
|
68
|
+
def __init__(self):
|
69
|
+
mssparkutils.credentials.getToken("pbi")
|
70
|
+
print("Using Synapse Spark Utils for authentication")
|
71
|
+
|
72
|
+
def get_token(self):
|
73
|
+
"""Get token from Azure AD"""
|
74
|
+
token = mssparkutils.credentials.getToken("pbi")
|
75
|
+
return token.token
|
76
|
+
|
77
|
+
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import os
|
2
2
|
from time import sleep
|
3
3
|
|
4
|
-
from msfabricpysdkcore.auth import FabricAuthClient, FabricServicePrincipal
|
4
|
+
from msfabricpysdkcore.auth import FabricAuthClient, FabricServicePrincipal, FabricSparkUtilsAuthentication
|
5
5
|
|
6
6
|
class FabricClient():
|
7
7
|
"""FabricClient class to interact with Fabric API"""
|
@@ -12,11 +12,14 @@ class FabricClient():
|
|
12
12
|
self.client_id = client_id if client_id else os.getenv("FABRIC_CLIENT_ID")
|
13
13
|
self.client_secret = client_secret if client_secret else os.getenv("FABRIC_CLIENT_SECRET")
|
14
14
|
|
15
|
+
self.scope = "https://api.fabric.microsoft.com/.default"
|
16
|
+
|
15
17
|
if self.client_id is None or self.client_secret is None or self.tenant_id is None:
|
16
|
-
|
18
|
+
try:
|
19
|
+
self.auth = FabricSparkUtilsAuthentication()
|
20
|
+
except:
|
21
|
+
self.auth = FabricAuthClient()
|
17
22
|
else:
|
18
23
|
self.auth = FabricServicePrincipal(tenant_id = self.tenant_id,
|
19
24
|
client_id = self.client_id,
|
20
|
-
client_secret = self.client_secret)
|
21
|
-
|
22
|
-
self.scope = "https://api.fabric.microsoft.com/.default"
|
25
|
+
client_secret = self.client_secret)
|
@@ -302,8 +302,8 @@ class TestFabricClientCore(unittest.TestCase):
|
|
302
302
|
fc = self.fc
|
303
303
|
workspace = fc.get_workspace_by_name("testitems")
|
304
304
|
workspace_id = workspace.id
|
305
|
-
|
306
|
-
model_name = "
|
305
|
+
datetime_str = datetime.now().strftime("%Y%m%d%H%M%S")
|
306
|
+
model_name = "mlm" + datetime_str
|
307
307
|
|
308
308
|
ml_model = fc.create_ml_model(workspace_id, display_name=model_name)
|
309
309
|
self.assertEqual(ml_model.display_name, model_name)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/long_running_operation.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/tests/test_admin_apis.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore/tests/test_shortcuts.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
{msfabricpysdkcore-0.0.7 → msfabricpysdkcore-0.0.8}/msfabricpysdkcore.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|