|
18 | 18 | "## Prerequisites\n", |
19 | 19 | "\n", |
20 | 20 | "If you have already completed the prerequisites and selected the correct Kernel for this notebook, the AML Python SDK \n", |
21 | | - "is already installed. Let's load the imports and check the AML SDK version." |
22 | | - ] |
23 | | - }, |
24 | | - { |
25 | | - "cell_type": "code", |
26 | | - "execution_count": null, |
27 | | - "metadata": { |
28 | | - "pycharm": { |
29 | | - "name": "#%%\n" |
30 | | - } |
31 | | - }, |
32 | | - "outputs": [], |
33 | | - "source": [ |
34 | | - "import json\n", |
| 21 | + "is already installed. Let's load the imports and check the AML SDK version.\n", |
35 | 22 | "\n", |
36 | | - "import azureml.core\n", |
37 | | - "from azure_utils.machine_learning.utils import load_configuration, get_or_create_workspace\n", |
38 | | - "\n", |
39 | | - "print(\"AML SDK Version:\", azureml.core.VERSION)" |
40 | | - ] |
41 | | - }, |
42 | | - { |
43 | | - "cell_type": "markdown", |
44 | | - "metadata": {}, |
45 | | - "source": [ |
46 | 23 | "## Set up your Azure Machine Learning workspace\n", |
47 | 24 | "## Load Configurations from file\n", |
48 | 25 | "\n", |
49 | | - "Configurations are loaded from a file, to prevent accident commits of Azure secerts into source control.\n", |
50 | | - "This file name is included in the .gitignore to also prevent accident commits. A template file is included that should\n", |
51 | | - "be copied, and each parameter filled in." |
52 | | - ] |
53 | | - }, |
54 | | - { |
55 | | - "cell_type": "code", |
56 | | - "execution_count": null, |
57 | | - "metadata": { |
58 | | - "pycharm": { |
59 | | - "name": "#%%\n" |
60 | | - } |
61 | | - }, |
62 | | - "outputs": [], |
63 | | - "source": [ |
64 | | - "cfg = load_configuration(\"../workspace_conf.yml\")" |
65 | | - ] |
66 | | - }, |
67 | | - { |
68 | | - "cell_type": "markdown", |
69 | | - "metadata": { |
70 | | - "pycharm": { |
71 | | - "name": "#%% md\n" |
72 | | - } |
73 | | - }, |
74 | | - "source": [ |
75 | | - "## Load Configurations into Notebook.\n", |
| 26 | + "Configurations are loaded by default from a file `project.yml`, to prevent accident commits of Azure secrets into \n", |
| 27 | + "source control. This file name is included in the `.gitignore` to also prevent accident commits. A template file \n", |
| 28 | + "is included that should be copied, and each parameter filled in.\n", |
| 29 | + "\n", |
| 30 | + "If the file is not present, and UI Prompt will pop up to insert configurations, and save to the file.\n", |
76 | 31 | "\n", |
77 | | - "The following cell loads the configurations from the local file, into the notebook memory. The following cell is also\n", |
78 | | - "marked as a parameter cell. When using this notebook with [papermill](https://github.com/nteract/papermill), these\n", |
79 | | - "parameters can be override. See the tests for examples." |
80 | | - ] |
81 | | - }, |
82 | | - { |
83 | | - "cell_type": "code", |
84 | | - "execution_count": null, |
85 | | - "metadata": { |
86 | | - "pycharm": { |
87 | | - "name": "#%%\n" |
88 | | - }, |
89 | | - "tags": [ |
90 | | - "parameters" |
91 | | - ] |
92 | | - }, |
93 | | - "outputs": [], |
94 | | - "source": [ |
95 | | - "subscription_id = cfg['subscription_id']\n", |
96 | | - "resource_group = cfg['resource_group']\n", |
97 | | - "workspace_name = cfg['workspace_name']\n", |
98 | | - "workspace_region = cfg['workspace_region']" |
99 | | - ] |
100 | | - }, |
101 | | - { |
102 | | - "cell_type": "markdown", |
103 | | - "metadata": {}, |
104 | | - "source": [ |
105 | 32 | "## Create the workspace\n", |
106 | | - "This cell will create an AML workspace for you in a subscription, provided you have the correct permissions.\n", |
| 33 | + "This cell will also create an AML workspace for you in a subscription, provided you have the correct permissions.\n", |
107 | 34 | "\n", |
108 | 35 | "This will fail when:\n", |
109 | 36 | "1. You do not have permission to create a workspace in the resource group\n", |
|
112 | 39 | "subscription\n", |
113 | 40 | "\n", |
114 | 41 | "If workspace creation fails, please work with your IT admin to provide you with the appropriate permissions or to \n", |
115 | | - "provision the required resources. If this cell succeeds, you're done configuring AML!\n" |
116 | | - ] |
117 | | - }, |
118 | | - { |
119 | | - "cell_type": "code", |
120 | | - "execution_count": null, |
121 | | - "metadata": { |
122 | | - "pycharm": { |
123 | | - "name": "#%%\n" |
124 | | - } |
125 | | - }, |
126 | | - "outputs": [], |
127 | | - "source": [ |
128 | | - "ws = get_or_create_workspace(workspace_name, subscription_id, resource_group, workspace_region)\n", |
129 | | - "ws_json = ws.get_details()" |
130 | | - ] |
131 | | - }, |
132 | | - { |
133 | | - "cell_type": "markdown", |
134 | | - "metadata": { |
135 | | - "pycharm": { |
136 | | - "name": "#%% md\n" |
137 | | - } |
138 | | - }, |
139 | | - "source": [ |
140 | | - "Let's check the details of the workspace." |
| 42 | + "provision the required resources. If this cell succeeds, you're done configuring AML!\n", |
| 43 | + "\n", |
| 44 | + "After creation we will check the details of the workspace." |
141 | 45 | ] |
142 | 46 | }, |
143 | 47 | { |
|
150 | 54 | }, |
151 | 55 | "outputs": [], |
152 | 56 | "source": [ |
153 | | - "print(json.dumps(ws_json, indent=2))" |
| 57 | + "from azure_utils.machine_learning.utils import get_or_create_workspace_from_file\n", |
| 58 | + "\n", |
| 59 | + "ws = get_or_create_workspace_from_file()" |
154 | 60 | ] |
155 | 61 | }, |
156 | 62 | { |
157 | 63 | "cell_type": "markdown", |
158 | | - "metadata": { |
159 | | - "pycharm": { |
160 | | - "name": "#%% md\n" |
161 | | - } |
162 | | - }, |
| 64 | + "metadata": {}, |
163 | 65 | "source": [ |
164 | | - "You are now ready to move on to the [AutoML Local](01_DataPrep.ipynb) notebook." |
| 66 | + "We can now move on to [Data Preperation](01_DataPrep.ipynb) notebook to train our model using Azure Machine \n", |
| 67 | + "Learning." |
165 | 68 | ] |
166 | 69 | } |
167 | 70 | ], |
|
172 | 75 | "language": "python", |
173 | 76 | "name": "az-ml-realtime-score" |
174 | 77 | }, |
175 | | - "language_info": { |
176 | | - "codemirror_mode": { |
177 | | - "name": "ipython", |
178 | | - "version": 3 |
179 | | - }, |
180 | | - "file_extension": ".py", |
181 | | - "mimetype": "text/x-python", |
182 | | - "name": "python", |
183 | | - "nbconvert_exporter": "python", |
184 | | - "pygments_lexer": "ipython3", |
185 | | - "version": "3.6.2" |
186 | | - }, |
187 | 78 | "pycharm": { |
188 | 79 | "stem_cell": { |
189 | 80 | "cell_type": "raw", |
190 | | - "source": [], |
191 | 81 | "metadata": { |
192 | 82 | "collapsed": false |
193 | | - } |
| 83 | + }, |
| 84 | + "source": [] |
194 | 85 | } |
195 | 86 | } |
196 | 87 | }, |
|
0 commit comments