|
205 | 205 | " 'type': 'azureblob',\n", |
206 | 206 | " 'subtype': None,\n", |
207 | 207 | " 'credentials': {\n", |
208 | | - " 'connectionString': f'STORAGECONNSTRING'\n", |
| 208 | + " 'connectionString': f'{STORAGECONNSTRING}'\n", |
209 | 209 | " },\n", |
210 | 210 | " 'container': {\n", |
211 | 211 | " 'name': f'{datasource_container}'\n", |
|
234 | 234 | "skillset_name = f'{datasource_container}-ss'\n", |
235 | 235 | "skillset_def = {\n", |
236 | 236 | " '@odata.etag': '\\'0x8D7F6C769AC06B2\\'',\n", |
237 | | - " 'name': f'skillset_name',\n", |
| 237 | + " 'name': f'{skillset_name}',\n", |
238 | 238 | " 'description': 'Skillset to enrich hotel reviews with aspect based sentiment',\n", |
239 | 239 | " 'skills': [\n", |
240 | 240 | " {\n", |
|
482 | 482 | " 'cognitiveServices': {\n", |
483 | 483 | " '@odata.type': '#Microsoft.Azure.Search.CognitiveServicesByKey',\n", |
484 | 484 | " '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", |
486 | 486 | " },\n", |
487 | 487 | " 'knowledgeStore': {\n", |
488 | | - " 'storageConnectionString': f'STORAGECONNSTRING',\n", |
| 488 | + " 'storageConnectionString': f'{STORAGECONNSTRING}',\n", |
489 | 489 | " 'projections': [\n", |
490 | 490 | " {\n", |
491 | 491 | " 'tables': [],\n", |
492 | 492 | " 'objects': [\n", |
493 | 493 | " {\n", |
494 | | - " 'storageContainer': f'datasource_container-enriched',\n", |
| 494 | + " 'storageContainer': f'{datasource_container}-enriched',\n", |
495 | 495 | " 'referenceKeyName': None,\n", |
496 | 496 | " 'generatedKeyName': None,\n", |
497 | 497 | " 'source': '/document/objectprojection',\n", |
|
527 | 527 | "source": [ |
528 | 528 | "indexname = f'{datasource_container}-idx'\n", |
529 | 529 | "index_def = {\n", |
530 | | - " \"name\":f'indexname',\n", |
| 530 | + " \"name\":f'{indexname}',\n", |
531 | 531 | " \"defaultScoringProfile\": \"\",\n", |
532 | 532 | " \"fields\": [\n", |
533 | 533 | " {\n", |
|
1024 | 1024 | "source": [ |
1025 | 1025 | "indexername = f'{datasource_container}-idxr'\n", |
1026 | 1026 | "indexer_def = {\n", |
1027 | | - " \"name\": f'indexername',\n", |
| 1027 | + " \"name\": f'{indexername}',\n", |
1028 | 1028 | " \"description\": \"Indexer to enrich hotel reviews\",\n", |
1029 | 1029 | " \"dataSourceName\": f'{datasource_container}-ds',\n", |
1030 | 1030 | " \"skillsetName\": f'{datasource_container}-ss',\n", |
|
1076 | 1076 | " ],\n", |
1077 | 1077 | " \"cache\": {\n", |
1078 | 1078 | " \"enableReprocessing\": True,\n", |
1079 | | - " \"storageConnectionString\": f'know_store_cache'\n", |
| 1079 | + " \"storageConnectionString\": f'{know_store_cache}'\n", |
1080 | 1080 | " }\n", |
1081 | 1081 | "}\n", |
1082 | 1082 | "r = requests.post(construct_Url(search_service, \"indexers\", None, None, api_version), data=json.dumps(indexer_def), headers=headers)\n", |
|
1142 | 1142 | }, |
1143 | 1143 | "outputs": [], |
1144 | 1144 | "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" |
1147 | 1147 | ] |
1148 | 1148 | }, |
1149 | 1149 | { |
|
1161 | 1161 | "source": [ |
1162 | 1162 | "from azureml.core import Workspace, Datastore\n", |
1163 | 1163 | "try:\n", |
1164 | | - " ws = Workspace.from_config()\n", |
| 1164 | + " ws = Workspace(subscription_id, resource_group, workspace_name)\n", |
1165 | 1165 | " print(ws.name, ws.location, ws.resource_group, ws.location, sep='\\t')\n", |
1166 | 1166 | " print('Library configuration succeeded')\n", |
1167 | 1167 | "except:\n", |
1168 | 1168 | " print('Workspace not found')\n", |
| 1169 | + " \n", |
1169 | 1170 | "ds = ws.get_default_datastore()" |
1170 | 1171 | ] |
1171 | 1172 | }, |
|
2207 | 2208 | "name": "python", |
2208 | 2209 | "nbconvert_exporter": "python", |
2209 | 2210 | "pygments_lexer": "ipython3", |
2210 | | - "version": "3.6.5" |
| 2211 | + "version": "3.7.3" |
2211 | 2212 | } |
2212 | 2213 | }, |
2213 | 2214 | "nbformat": 4, |
|
0 commit comments