Skip to content

Commit 6dbd9b0

Browse files
committed
edits
1 parent b304766 commit 6dbd9b0

6 files changed

+9
-170
lines changed

articles/search/includes/tutorial-add-search-website-load-index-copy-resource-name.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

articles/search/includes/tutorial-add-search-website-load-index-review.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

articles/search/includes/tutorial-all-search-website-load-index-rollback-changes.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,22 @@ The script uses the Azure SDK for Cognitive Search:
5757
* [NuGet package Azure.Search.Documents](https://www.nuget.org/packages/Azure.Search.Documents/)
5858
* [Reference Documentation](/dotnet/api/overview/azure/search)
5959

60-
1. In Visual Studio Code, open the `Program.cs` file in the subdirectory, `search-website/bulk-insert`, replace the following variables with your own values to authenticate with the Azure Search SDK:
60+
1. In Visual Studio Code, open the `Program.cs` file in the subdirectory, `search-website-functions-v4/bulk-insert`, replace the following variables with your own values to authenticate with the Azure Search SDK:
6161

6262
* YOUR-SEARCH-RESOURCE-NAME
6363
* YOUR-SEARCH-ADMIN-KEY
6464

65-
:::code language="csharp" source="~/azure-search-dotnet-samples/search-website/bulk-insert/Program.cs" highlight="16-19" :::
65+
:::code language="csharp" source="~/azure-search-dotnet-samples/search-website-functions-v4/bulk-insert/Program.cs" highlight="16-19" :::
6666

67-
1. Open an integrated terminal in Visual Studio Code for the project directory's subdirectory, `search-website/bulk-insert`, then run the following command to install the dependencies.
67+
1. Open an integrated terminal in Visual Studio Code for the project directory's subdirectory, `search-website-functions-v4/bulk-insert`, then run the following command to install the dependencies.
6868

6969
```bash
7070
dotnet restore
7171
```
7272

7373
## Run the bulk import script for Search
7474

75-
1. Continue using the integrated terminal in Visual Studio for the project directory's subdirectory, `search-website/bulk-insert`, to run the following bash command to run the `Program.cs` script:
75+
1. Continue using the integrated terminal in Visual Studio for the project directory's subdirectory, `search-website-functions-v4/bulk-insert`, to run the following bash command to run the `Program.cs` script:
7676
7777
```bash
7878
dotnet run

articles/search/tutorial-csharp-deploy-static-web-app.md

Lines changed: 2 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -7,118 +7,14 @@ author: diberry
77
ms.author: diberry
88
ms.service: cognitive-search
99
ms.topic: tutorial
10-
ms.date: 08/30/2022
10+
ms.date: 11/01/2022
1111
ms.custom: devx-track-csharp
1212
ms.devlang: csharp
1313
---
1414

1515
# 3 - Deploy the search-enabled .NET website
1616

17-
Deploy the search-enabled website as an Azure Static web app. This deployment includes both the React app and the Function app.
18-
19-
The Static Web app pulls the information and files for deployment from GitHub using your fork of the samples repository.
20-
21-
## Create a Static Web App in Visual Studio Code
22-
23-
1. Select **Azure** from the Activity Bar, then open **Resources** from the Side bar.
24-
25-
1. Right-click **Static Web Apps** and then select **Create Static Web App (Advanced)**.
26-
27-
:::image type="content" source="media/tutorial-javascript-create-load-index/visual-studio-code-create-static-web-app-resource-advanced.png" alt-text="Right-click **Static Web Apps** and then select **Create Static Web App (Advanced)**":::
28-
29-
1. If you see a pop-up window in VS Code asking which branch you want to deploy from, select the default branch, usually **master** or **main**.
30-
31-
This setting means only changes you commit to that branch are deployed to your static web app.
32-
33-
1. If you see a pop-up window asking you to commit your changes, do not do this. The secrets from the bulk import step should not be committed to the repository.
34-
35-
To rollback the changes, in VS Code select the Source Control icon in the Activity bar, then select each changed file in the Changes list and select the **Discard changes** icon.
36-
37-
1. Follow the prompts to provide the following information:
38-
39-
|Prompt|Enter|
40-
|--|--|
41-
|Enter the name for the new Static Web App.|Create a unique name for your resource. For example, you can prepend your name to the repository name such as, `joansmith-azure-search-dotnet-samples`. |
42-
|Select a resource group for new resources.|Use the resource group you created for this tutorial.|
43-
|Select a SKU| Select the free SKU for this tutorial.|
44-
|Choose build preset to configure default project structure.|Select **Custom**|
45-
|Select the location of your application code|`search-website`<br><br>This is the path, from the root of the repository, to your Azure Static web app. |
46-
|Select the location of your Azure Function code|`search-website/api`<br><br>This is the path, from the root of the repository, to your Azure Function app. |
47-
|Enter the path of your build output...|`build`<br><br>This is the path, from your Azure Static web app, to your generated files.|
48-
|Select a location for new resources.|Select a region close to you.|
49-
50-
1. The resource is created, select **Open Actions in GitHub** from the Notifications. This opens a browser window pointed to your forked repo.
51-
52-
The list of actions indicates your web app, both client and functions, were successfully pushed to your Azure Static Web App.
53-
54-
Wait until the build and deployment complete before continuing. This may take a minute or two to finish.
55-
56-
## Get Cognitive Search query key in Visual Studio Code
57-
58-
1. In Visual Studio Code, open the [Activity bar](https://code.visualstudio.com/docs/getstarted/userinterface), and select the Azure icon.
59-
60-
1. In the Side bar, select your Azure subscription under the **Azure: Cognitive Search** area, then right-click on your Search resource and select **Copy Query Key**.
61-
62-
:::image type="content" source="./media/tutorial-javascript-create-load-index/visual-studio-code-copy-query-key.png" alt-text="In the Side bar, select your Azure subscription under the **Azure: Cognitive Search** area, then right-click on your Search resource and select **Copy Query Key**.":::
63-
64-
1. Keep this query key, you will need to use it in the next section. The query key is able to query your Index.
65-
66-
## Add configuration settings in Azure portal
67-
68-
The Azure Function app won't return Search data until the Search secrets are in settings.
69-
70-
1. Select **Azure** from the Activity Bar.
71-
1. Right-click on your Static web app resource then select **Open in Portal**.
72-
73-
:::image type="content" source="media/tutorial-javascript-static-web-app/open-static-web-app-in-azure-portal.png" alt-text="Right-click on your JavaScript Static web app resource then select Open in Portal.":::
74-
75-
1. Select **Configuration** then select **+ Add**.
76-
77-
:::image type="content" source="media/tutorial-javascript-static-web-app/add-new-application-setting-to-static-web-app-in-portal.png" alt-text="Select Configuration then select Add for your JavaScript app.":::
78-
79-
1. Add each of the following settings:
80-
81-
|Setting|Your Search resource value|
82-
|--|--|
83-
|SearchApiKey|Your Search query key|
84-
|SearchServiceName|Your Search resource name|
85-
|SearchIndexName|`good-books`|
86-
|SearchFacets|`authors*,language_code`|
87-
88-
Azure Cognitive Search requires different syntax for filtering collections than it does for strings. Add a `*` after a field name to denote that the field is of type `Collection(Edm.String)`. This allows the Azure Function to add filters correctly to queries.
89-
90-
1. Select **Save** to save the settings.
91-
92-
:::image type="content" source="media/tutorial-javascript-static-web-app/save-new-application-setting-to-static-web-app-in-portal.png" alt-text="Select Save to save the settings for your JavaScript app..":::
93-
94-
1. Return to VS Code.
95-
1. Refresh your Static web app to see the Static web app's application settings.
96-
97-
:::image type="content" source="media/tutorial-javascript-static-web-app/visual-studio-code-extension-fresh-resource.png" alt-text="Refresh your JavaScript Static web app to see the Static web app's application settings.":::
98-
99-
## Use search in your Static web app
100-
101-
1. In Visual Studio Code, open the [Activity bar](https://code.visualstudio.com/docs/getstarted/userinterface), and select the Azure icon.
102-
1. In the Side bar, **right-click on your Azure subscription** under the `Static web apps` area and find the Static web app you created for this tutorial.
103-
1. Right-click the Static Web App name and select **Browse site**.
104-
105-
:::image type="content" source="media/tutorial-javascript-create-load-index/visual-studio-code-browse-static-web-app.png" alt-text="Right-click the Static Web App name and select **Browse site**.":::
106-
107-
1. Select **Open** in the pop-up dialog.
108-
1. In the website search bar, enter a search query such as `code`, _slowly_ so the suggest feature suggests book titles. Select a suggestion or continue entering your own query. Press enter when you've completed your search query.
109-
1. Review the results then select one of the books to see more details.
110-
111-
## Clean up resources
112-
113-
To clean up the resources created in this tutorial, delete the resource group.
114-
115-
1. In Visual Studio Code, open the [Activity bar](https://code.visualstudio.com/docs/getstarted/userinterface), and select the Azure icon.
116-
117-
1. In the Side bar, **right-click on your Azure subscription** under the `Resource Groups` area and find the resource group you created for this tutorial.
118-
1. Right-click the resource group name then select **Delete**.
119-
This deletes both the Search and Static web app resources.
120-
1. If you no longer want the GitHub fork of the sample, remember to delete that on GitHub. Go to your fork's **Settings** then delete the fork.
121-
17+
[!INCLUDE [tutorial-deploy](includes/tutorial-add-search-website-create-app.md)]
12218

12319
## Next steps
12420

articles/search/tutorial-csharp-search-query-integration.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: diberry
77
ms.author: diberry
88
ms.service: cognitive-search
99
ms.topic: tutorial
10-
ms.date: 04/23/2021
10+
ms.date: 11/01/2022
1111
ms.custom: devx-track-csharp
1212
ms.devlang: csharp
1313
---
@@ -17,7 +17,7 @@ ms.devlang: csharp
1717
In the previous lessons, you added search to a Static Web App. This lesson highlights the essential steps that establish integration. If you are looking for a cheat sheet on how to integrate search into your web app, this article explains what you need to know.
1818

1919
The application is available:
20-
* [Sample](https://github.com/azure-samples/azure-search-dotnet-samples/tree/master/search-website)
20+
* [Sample](https://github.com/azure-samples/azure-search-dotnet-samples/tree/master/search-website-functions-v4)
2121
* [Demo website - aka.ms/azs-good-books](https://aka.ms/azs-good-books)
2222

2323
## Azure SDK Azure.Search.Documents
@@ -31,24 +31,7 @@ The Function app authenticates through the SDK to the cloud-based Cognitive Sear
3131

3232
## Configure secrets in a local.settings.json file
3333

34-
1. Create a new file named `local.settings.json` at `./api/` and copy the following JSON object into the file.
35-
36-
```json
37-
{
38-
"IsEncrypted": false,
39-
"Values": {
40-
"AzureWebJobsStorage": "",
41-
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
42-
"SearchApiKey": "YOUR_SEARCH_QUERY_KEY",
43-
"SearchServiceName": "YOUR_SEARCH_RESOURCE_NAME",
44-
"SearchIndexName": "good-books"
45-
}
46-
}
47-
```
48-
49-
1. Change the following for you own Search resource values:
50-
* YOUR_SEARCH_RESOURCE_NAME
51-
* YOUR_SEARCH_QUERY_KEY
34+
:::code language="javascript" source="~/azure-search-javascript-samples/search-website-functions-v4/api/config.js":::
5235

5336
## Azure Function: Search the catalog
5437

0 commit comments

Comments
 (0)