-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAML.py
More file actions
27 lines (19 loc) · 706 Bytes
/
AML.py
File metadata and controls
27 lines (19 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
from azureml.core.authentication import ServicePrincipalAuthentication
from azureml.core import Workspace
from configparser import SafeConfigParser
class AML:
def __init__(self):
parser = SafeConfigParser()
parser.read('config.ini')
svc_pr = ServicePrincipalAuthentication(
tenant_id=parser.get('SP', 'tenantid'),
service_principal_id=parser.get('SP','service_principal_id'),
service_principal_password=parser.get('SP', 'password'))
ws = Workspace(
subscription_id=parser.get('AML', 'subscription_id'),
resource_group=parser.get('AML', 'resource_group'),
workspace_name=parser.get('AML', 'workspace_name'),
auth=svc_pr
)
self.ws = ws