Skip to content

Commit cacb774

Browse files
authored
Merge pull request #220322 from HeidiSteen/heidist-vscode
Replace VS Code Extension with PS steps
2 parents 8816e87 + df769bd commit cacb774

File tree

3 files changed

+120
-57
lines changed

3 files changed

+120
-57
lines changed

articles/search/tutorial-csharp-create-load-index.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,69 @@ author: diberry
77
ms.author: diberry
88
ms.service: cognitive-search
99
ms.topic: tutorial
10-
ms.date: 11/01/2022
10+
ms.date: 12/04/2022
1111
ms.custom: devx-track-csharp
1212
ms.devlang: csharp
1313
---
1414

1515
# 2 - Create and load Search Index with .NET
1616

17-
Continue to build your Search-enabled website by:
18-
* Create a Search resource with the VS Code extension
17+
Continue to build your search-enabled website by following these steps:
18+
* Create a search resource
1919
* Create a new index
2020
* Import data with .NET using the sample script and Azure SDK [Azure.Search.Documents](https://www.nuget.org/packages/Azure.Search.Documents/).
2121

22-
## Create an Azure Search resource
22+
## Create an Azure Cognitive Search resource
2323

24-
Create a new Search resource with the Azure Cognitive Search extension for Visual Studio Code.
24+
Create a new search resource using PowerShell and the **Az.Search** module.
2525

26-
1. In Visual Studio Code, open the [Activity bar](https://code.visualstudio.com/docs/getstarted/userinterface), and select the Azure icon.
26+
1. In Visual Studio Code, open a new terminal window.
2727

28-
1. In the Side bar, **right-click on your Azure subscription** under the `Azure: Cognitive Search` area and select **Create new search service**.
28+
1. Connect to Azure:
2929

30-
:::image type="content" source="./media/tutorial-javascript-create-load-index/visual-studio-code-create-search-resource.png" alt-text="Screenshot of Visual Studio code showing the Azure explorer bar, right-click on your Azure subscription under the Azure: Cognitive Search area and select Create new search service.":::
30+
```powershell
31+
Connect-AzAccount -TenantID <your-tenant-ID>
32+
```
3133

32-
1. Follow the prompts to provide the following information:
34+
> [!NOTE]
35+
> You might need to provide a tenant ID, which you can find in the Azure portal in [Portal settings > Directories + subscriptions](/azure/azure-portal/set-preferences).
36+
37+
1. Before creating a new search service, you can list existing search services for your subscription to see if there's one you want to use:
38+
39+
```powershell
40+
Get-AzResource -ResourceType Microsoft.Search/searchServices | ft
41+
```
42+
43+
1. Load the **Az.Search** module:
44+
45+
```powershell
46+
Install-Module -Name Az.Search
47+
```
48+
49+
1. Create a new search service. Use the following cmdlet as a template, substituting valid values for the resource group, service name, tier, region, partitions, and replicas:
50+
51+
```powershell
52+
New-AzSearchService -ResourceGroupName "my resource group" -Name "myDemoSearchSvc" -Sku "Free" -Location "West US" -PartitionCount 1 -ReplicaCount 1 -HostingMode Default
53+
```
3354

3455
|Prompt|Enter|
3556
|--|--|
36-
|Enter a globally unique name for the new Search Service.|**Remember this name**. This resource name becomes part of your resource endpoint.|
57+
|Enter a globally unique name for the new search service.|**Remember this name**. This resource name becomes part of your resource endpoint.|
3758
|Select a resource group for new resources|Use the resource group you created for this tutorial.|
38-
|Select the SKU for your Search service.|Select **Free** for this tutorial. You can't change a SKU pricing tier after the service is created.|
59+
|Select the SKU for your search service.|Use **Free** for this tutorial. You can't change a SKU pricing tier after the service is created.|
3960
|Select a location for new resources.|Select a region close to you.|
4061

41-
1. After you complete the prompts, your new Search resource is created.
42-
43-
## Get your Search resource admin key
44-
45-
Get your Search resource admin key with the Visual Studio Code extension.
62+
1. Create a query key that grants read access to a search service. Query keys have to be explicitly created. Copy the query key to Notepad so that you can paste it into the client code in a later step:
4663

47-
1. In Visual Studio Code, in the Side bar, right-click on your Search resource and select **Copy Admin Key**.
64+
```powershell
65+
New-AzSearchQueryKey -ResourceGroupName "my resource group" -ServiceName "myDemoSearchSvc" -Name "mySrchQueryKey"
66+
```
4867

49-
:::image type="content" source="./media/tutorial-javascript-create-load-index/visual-studio-code-copy-admin-key.png" alt-text="Screenshot of Visual Studio code showing the Azure explorer bar, right-click on your Search resource and select Copy Admin Key.":::
68+
1. Get the search service admin API key that was automatically created for your search service. An admin API key provides write access to the search service. Copy either one of the admin keys to Notepad so that you can use it in the bulk import step that creates and loads an index:
5069

51-
1. Keep this admin key, you'll need to use it in [a later section](#prepare-the-bulk-import-script-for-search).
70+
```powershell
71+
Get-AzSearchAdminKeyPair -ResourceGroupName "my resource group" -ServiceName "myDemoSearchSvc"
72+
```
5273

5374
## Prepare the bulk import script for Search
5475

articles/search/tutorial-javascript-create-load-index.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,69 @@ author: diberry
77
ms.author: diberry
88
ms.service: cognitive-search
99
ms.topic: tutorial
10-
ms.date: 11/01/2022
10+
ms.date: 12/04/2022
1111
ms.custom: devx-track-js
1212
ms.devlang: javascript
1313
---
1414

1515
# 2 - Create and load Search Index with JavaScript
1616

17-
Continue to build your Search-enabled website by:
18-
* Create a Search resource with the VS Code extension
17+
Continue to build your search-enabled website by following these steps:
18+
* Create a search resource
1919
* Create a new index
2020
* Import data with JavaScript using the [sample script](https://github.com/Azure-Samples/azure-search-javascript-samples/blob/main/search-website-functions-v4/bulk-insert/bulk_insert_books.js) and Azure SDK [@azure/search-documents](https://www.npmjs.com/package/@azure/search-documents).
2121

22-
## Create an Azure Search resource
22+
## Create an Azure Cognitive Search resource
2323

24-
Create a new Search resource with the Azure Cognitive Search extension for Visual Studio Code.
24+
Create a new search resource using PowerShell and the **Az.Search** module.
2525

26-
1. In Visual Studio Code, open the [Activity bar](https://code.visualstudio.com/docs/getstarted/userinterface), and select the Azure icon.
26+
1. In Visual Studio Code, open a new terminal window.
2727

28-
1. In the Side bar, **right-click on your Azure subscription** under the `Azure: Cognitive Search` area and select **Create new search service**.
28+
1. Connect to Azure:
2929

30-
:::image type="content" source="./media/tutorial-javascript-create-load-index/visual-studio-code-create-search-resource.png" alt-text="Screenshot of Visual Studio Code showing Azure explorer, right-click on your Azure subscription under the Azure: Cognitive Search area and select Create new search service.":::
30+
```powershell
31+
Connect-AzAccount -TenantID <your-tenant-ID>
32+
```
3133

32-
1. Follow the prompts to provide the following information:
34+
> [!NOTE]
35+
> You might need to provide a tenant ID, which you can find in the Azure portal in [Portal settings > Directories + subscriptions](/azure/azure-portal/set-preferences).
36+
37+
1. Before creating a new search service, you can list existing search services for your subscription to see if there's one you want to use:
38+
39+
```powershell
40+
Get-AzResource -ResourceType Microsoft.Search/searchServices | ft
41+
```
42+
43+
1. Load the **Az.Search** module:
44+
45+
```powershell
46+
Install-Module -Name Az.Search
47+
```
48+
49+
1. Create a new search service. Use the following cmdlet as a template, substituting valid values for the resource group, service name, tier, region, partitions, and replicas:
50+
51+
```powershell
52+
New-AzSearchService -ResourceGroupName "my resource group" -Name "myDemoSearchSvc" -Sku "Free" -Location "West US" -PartitionCount 1 -ReplicaCount 1 -HostingMode Default
53+
```
3354

3455
|Prompt|Enter|
3556
|--|--|
36-
|Enter a globally unique name for the new Search Service.|**Remember this name**. This resource name becomes part of your resource endpoint.|
57+
|Enter a globally unique name for the new search service.|**Remember this name**. This resource name becomes part of your resource endpoint.|
3758
|Select a resource group for new resources|Use the resource group you created for this tutorial.|
38-
|Select the SKU for your Search service.|Select **Free** for this tutorial. You can't change a SKU pricing tier after the service is created.|
59+
|Select the SKU for your search service.|Use **Free** for this tutorial. You can't change a SKU pricing tier after the service is created.|
3960
|Select a location for new resources.|Select a region close to you.|
4061

41-
1. After you complete the prompts, your new Search resource is created.
42-
43-
## Get your Search resource admin key
44-
45-
Get your Search resource admin key with the Visual Studio Code extension.
62+
1. Create a query key that grants read access to a search service. Query keys have to be explicitly created. Copy the query key to Notepad so that you can paste it into the client code in a later step:
4663

47-
1. In Visual Studio Code, in the Side bar, right-click on your Search resource and select **Copy Admin Key**.
64+
```powershell
65+
New-AzSearchQueryKey -ResourceGroupName "my resource group" -ServiceName "myDemoSearchSvc" -Name "mySrchQueryKey"
66+
```
4867

49-
:::image type="content" source="./media/tutorial-javascript-create-load-index/visual-studio-code-copy-admin-key.png" alt-text="Screenshot of Visual Studio Code showing Azure explorer, right-click on your Search resource and select Copy Admin Key.":::
68+
1. Get the search service admin API key that was automatically created for your search service. An admin API key provides write access to the search service. Copy either one of the admin keys to Notepad so that you can use it in the bulk import step that creates and loads an index:
5069

51-
1. Keep this admin key, you'll need to use it in [a later section](#prepare-the-bulk-import-script-for-search).
70+
```powershell
71+
Get-AzSearchAdminKeyPair -ResourceGroupName "my resource group" -ServiceName "myDemoSearchSvc"
72+
```
5273

5374
## Prepare the bulk import script for Search
5475

articles/search/tutorial-python-create-load-index.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,69 @@ author: diberry
77
ms.author: diberry
88
ms.service: cognitive-search
99
ms.topic: tutorial
10-
ms.date: 11/02/2022
10+
ms.date: 12/04/2022
1111
ms.custom: devx-track-python
1212
ms.devlang: python
1313
---
1414

1515
# 2 - Create and load Search Index with Python
1616

17-
Continue to build your Search-enabled website by:
18-
* Create a Search resource with the VS Code extension
17+
Continue to build your search-enabled website by following these steps:
18+
* Create a search resource
1919
* Create a new index
2020
* Import data with Python using the [sample script](https://github.com/Azure-Samples/azure-search-python-samples/blob/main/search-website-functions-v4/bulk-upload/bulk-upload.py) and Azure SDK [azure-search-documents](https://pypi.org/project/azure-search-documents/).
2121

22-
## Create an Azure Cognitive Search resource
22+
## Create an Azure Cognitive Search resource
2323

24-
Create a new Search resource with the Azure Cognitive Search extension for Visual Studio Code.
24+
Create a new search resource using PowerShell and the **Az.Search** module.
2525

26-
1. In Visual Studio Code, open the [Activity bar](https://code.visualstudio.com/docs/getstarted/userinterface), and select the Azure icon.
26+
1. In Visual Studio Code, open a new terminal window.
2727

28-
1. In the Side bar, **right-click on your Azure subscription** under the `Azure: Cognitive Search` area and select **Create new search service**.
28+
1. Connect to Azure:
2929

30-
:::image type="content" source="./media/tutorial-javascript-create-load-index/visual-studio-code-create-search-resource.png" alt-text="Screenshot of Visual Studio Code showing the Azure explorer, right-click on your Azure subscription under the Azure: Cognitive Search area and select Create new search service.":::
30+
```powershell
31+
Connect-AzAccount -TenantID <your-tenant-ID>
32+
```
3133

32-
1. Follow the prompts to provide the following information:
34+
> [!NOTE]
35+
> You might need to provide a tenant ID, which you can find in the Azure portal in [Portal settings > Directories + subscriptions](/azure/azure-portal/set-preferences).
36+
37+
1. Before creating a new search service, you can list existing search services for your subscription to see if there's one you want to use:
38+
39+
```powershell
40+
Get-AzResource -ResourceType Microsoft.Search/searchServices | ft
41+
```
42+
43+
1. Load the **Az.Search** module:
44+
45+
```powershell
46+
Install-Module -Name Az.Search
47+
```
48+
49+
1. Create a new search service. Use the following cmdlet as a template, substituting valid values for the resource group, service name, tier, region, partitions, and replicas:
50+
51+
```powershell
52+
New-AzSearchService -ResourceGroupName "my resource group" -Name "myDemoSearchSvc" -Sku "Free" -Location "West US" -PartitionCount 1 -ReplicaCount 1 -HostingMode Default
53+
```
3354

3455
|Prompt|Enter|
3556
|--|--|
36-
|Enter a globally unique name for the new Search Service.|**Remember this name**. This resource name becomes part of your resource endpoint.|
57+
|Enter a globally unique name for the new search service.|**Remember this name**. This resource name becomes part of your resource endpoint.|
3758
|Select a resource group for new resources|Use the resource group you created for this tutorial.|
38-
|Select the SKU for your Search service.|Select **Free** for this tutorial. You can't change a pricing tier after the service is created.|
59+
|Select the SKU for your search service.|Use **Free** for this tutorial. You can't change a SKU pricing tier after the service is created.|
3960
|Select a location for new resources.|Select a region close to you.|
4061

41-
1. After you complete the prompts, your new Search resource is created.
42-
43-
## Get your Search resource admin key
44-
45-
Get your Search resource admin key with the Visual Studio Code extension.
62+
1. Create a query key that grants read access to a search service. Query keys have to be explicitly created. Copy the query key to Notepad so that you can paste it into the client code in a later step:
4663

47-
1. In Visual Studio Code, in the Side bar, right-click on your Search resource and select **Copy Admin Key**.
64+
```powershell
65+
New-AzSearchQueryKey -ResourceGroupName "my resource group" -ServiceName "myDemoSearchSvc" -Name "mySrchQueryKey"
66+
```
4867

49-
:::image type="content" source="./media/tutorial-javascript-create-load-index/visual-studio-code-copy-admin-key.png" alt-text="Screenshot of Visual Studio Code showing the Azure explorer, right-click on your Search resource and select Copy Admin Key.":::
68+
1. Get the search service admin API key that was automatically created for your search service. An admin API key provides write access to the search service. Copy either one of the admin keys to Notepad so that you can use it in the bulk import step that creates and loads an index:
5069

51-
1. Keep this admin key, you'll need to use it to create objects in [a later section](#prepare-the-bulk-import-script-for-search).
70+
```powershell
71+
Get-AzSearchAdminKeyPair -ResourceGroupName "my resource group" -ServiceName "myDemoSearchSvc"
72+
```
5273

5374
## Prepare the bulk import script for Search
5475

0 commit comments

Comments
 (0)