-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorkspaceConfigFile.py
More file actions
65 lines (40 loc) · 1.75 KB
/
WorkspaceConfigFile.py
File metadata and controls
65 lines (40 loc) · 1.75 KB
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
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
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import os
os.chdir('C:/Users/Shubham Kansal/Desktop/Python_Directory/ModelDeployment')
# ## Workspace & ResourceGroup
# In[1]:
from azureml.core import Workspace, Dataset, Datastore
ws = Workspace.create(name='Deployment_Workspace',
subscription_id='597aaac7-ba77-4b65-a624-d472f5085556',
resource_group='TestDeployment',
create_resource_group=True, # True if it does not exist
location='eastus',
exist_ok= True)
ws.write_config(path=".")
# ## Datastore
# In[2]:
from azureml.core import Datastore
az_store = Datastore.register_azure_blob_container(
workspace=ws,
datastore_name="deploydatastore",
account_name="depstorageact",
container_name="deploycontainer",
account_key="JApqGoyp+TkqmCNnJVpQD0BUqQyVbnO8zt1e/vVBbr2/+71iK1+DWMdlUq+b9JX7xwFl+CGdZ8x08hpCZrdBHg==")
# ## Dataset
# In[3]:
from azureml.core import Dataset
az_store = Datastore.get(ws, "deploydatastore")
# -----------------------------------------------------
# Create and register the dataset
# -----------------------------------------------------
# Create the path of the csv file
csv_path = [(az_store, "Dataset/adultIncome.csv")] #path of the file stored in the storage account
# Create the dataset
loan_dataset = Dataset.Tabular.from_delimited_files(path=csv_path)
# Register the dataset
loan_dataset = loan_dataset.register(workspace=ws,
name="Deploydataset",
create_new_version=True)
***************************************************ConfigurationEnd************************************************************