Skip to content

Commit e2495b0

Browse files
fixing variables in resource creation
1 parent 1a4b352 commit e2495b0

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

AzureML-Custom-Skill/notebook/custom_skill_azureml.ipynb

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
" 'type': 'azureblob',\n",
206206
" 'subtype': None,\n",
207207
" 'credentials': {\n",
208-
" 'connectionString': f'STORAGECONNSTRING'\n",
208+
" 'connectionString': f'{STORAGECONNSTRING}'\n",
209209
" },\n",
210210
" 'container': {\n",
211211
" 'name': f'{datasource_container}'\n",
@@ -234,7 +234,7 @@
234234
"skillset_name = f'{datasource_container}-ss'\n",
235235
"skillset_def = {\n",
236236
" '@odata.etag': '\\'0x8D7F6C769AC06B2\\'',\n",
237-
" 'name': f'skillset_name',\n",
237+
" 'name': f'{skillset_name}',\n",
238238
" 'description': 'Skillset to enrich hotel reviews with aspect based sentiment',\n",
239239
" 'skills': [\n",
240240
" {\n",
@@ -482,16 +482,16 @@
482482
" 'cognitiveServices': {\n",
483483
" '@odata.type': '#Microsoft.Azure.Search.CognitiveServicesByKey',\n",
484484
" 'description': '/subscriptions/subscription_id/resourceGroups/resource_group/providers/Microsoft.CognitiveServices/accounts/cog_svcs_acct',\n",
485-
" 'key': f'cog_svcs_key'\n",
485+
" 'key': f'{cog_svcs_key}'\n",
486486
" },\n",
487487
" 'knowledgeStore': {\n",
488-
" 'storageConnectionString': f'STORAGECONNSTRING',\n",
488+
" 'storageConnectionString': f'{STORAGECONNSTRING}',\n",
489489
" 'projections': [\n",
490490
" {\n",
491491
" 'tables': [],\n",
492492
" 'objects': [\n",
493493
" {\n",
494-
" 'storageContainer': f'datasource_container-enriched',\n",
494+
" 'storageContainer': f'{datasource_container}-enriched',\n",
495495
" 'referenceKeyName': None,\n",
496496
" 'generatedKeyName': None,\n",
497497
" 'source': '/document/objectprojection',\n",
@@ -527,7 +527,7 @@
527527
"source": [
528528
"indexname = f'{datasource_container}-idx'\n",
529529
"index_def = {\n",
530-
" \"name\":f'indexname',\n",
530+
" \"name\":f'{indexname}',\n",
531531
" \"defaultScoringProfile\": \"\",\n",
532532
" \"fields\": [\n",
533533
" {\n",
@@ -1024,7 +1024,7 @@
10241024
"source": [
10251025
"indexername = f'{datasource_container}-idxr'\n",
10261026
"indexer_def = {\n",
1027-
" \"name\": f'indexername',\n",
1027+
" \"name\": f'{indexername}',\n",
10281028
" \"description\": \"Indexer to enrich hotel reviews\",\n",
10291029
" \"dataSourceName\": f'{datasource_container}-ds',\n",
10301030
" \"skillsetName\": f'{datasource_container}-ss',\n",
@@ -1076,7 +1076,7 @@
10761076
" ],\n",
10771077
" \"cache\": {\n",
10781078
" \"enableReprocessing\": True,\n",
1079-
" \"storageConnectionString\": f'know_store_cache'\n",
1079+
" \"storageConnectionString\": f'{know_store_cache}'\n",
10801080
" }\n",
10811081
"}\n",
10821082
"r = requests.post(construct_Url(search_service, \"indexers\", None, None, api_version), data=json.dumps(indexer_def), headers=headers)\n",
@@ -1142,8 +1142,8 @@
11421142
},
11431143
"outputs": [],
11441144
"source": [
1145-
"!pip install azure-storage-blob\n",
1146-
"!pip install --upgrade azureml-sdk"
1145+
"%pip install azure-storage-blob\n",
1146+
"%pip install --upgrade azureml-sdk"
11471147
]
11481148
},
11491149
{
@@ -1161,11 +1161,12 @@
11611161
"source": [
11621162
"from azureml.core import Workspace, Datastore\n",
11631163
"try:\n",
1164-
" ws = Workspace.from_config()\n",
1164+
" ws = Workspace(subscription_id, resource_group, workspace_name)\n",
11651165
" print(ws.name, ws.location, ws.resource_group, ws.location, sep='\\t')\n",
11661166
" print('Library configuration succeeded')\n",
11671167
"except:\n",
11681168
" print('Workspace not found')\n",
1169+
" \n",
11691170
"ds = ws.get_default_datastore()"
11701171
]
11711172
},
@@ -2207,7 +2208,7 @@
22072208
"name": "python",
22082209
"nbconvert_exporter": "python",
22092210
"pygments_lexer": "ipython3",
2210-
"version": "3.6.5"
2211+
"version": "3.7.3"
22112212
}
22122213
},
22132214
"nbformat": 4,

0 commit comments

Comments
 (0)