Skip to content

Commit fcd0a4b

Browse files
author
dksimpson
committed
Edits
1 parent f7ea53b commit fcd0a4b

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

articles/cognitive-services/Bing-Autosuggest/includes/quickstarts/autosuggest-client-library-csharp.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Use the Bing Autosuggest client library for .NET to get search suggestions based
1818

1919
## Prerequisites
2020

21-
* Azure subscription - [Create one for free](https://azure.microsoft.com/free/)
21+
* An Azure subscription. If you don't already have an Azure subscription, [create one for free](https://azure.microsoft.com/free/).
2222
* The current version of [.NET Core](https://dotnet.microsoft.com/download/dotnet-core).
2323

2424
[!INCLUDE [cognitive-services-bing-autosuggest-signup-requirements](~/includes/cognitive-services-bing-autosuggest-signup-requirements.md)]
@@ -30,9 +30,8 @@ Use the Bing Autosuggest client library for .NET to get search suggestions based
3030
3131
Using your key and endpoint from the resource you created, create two environment variables for authentication:
3232
<!-- replace the below variable names with the names expected in the code sample.-->
33-
* `AUTOSUGGEST_SUBSCRIPTION_KEY` - The resource key for authenticating your requests.
34-
* `AUTOSUGGEST_ENDPOINT` - The resource endpoint for sending API requests. It will look like this:
35-
* `https://<your-custom-subdomain>.api.cognitive.microsoft.com`
33+
* `AUTOSUGGEST_SUBSCRIPTION_KEY`: The resource key for authenticating your requests.
34+
* `AUTOSUGGEST_ENDPOINT`: The resource endpoint for sending API requests. It should look like this: `https://<your-custom-subdomain>.api.cognitive.microsoft.com`.
3635

3736
Use the instructions for your operating system.
3837
<!-- replace the below endpoint and key examples -->
@@ -141,10 +140,10 @@ These code snippets show you how to do the following tasks with the Bing Autosug
141140
* [Authenticate the client](#authenticate-the-client)
142141
* [Send an autosuggest request](#send-an-autosuggest-request)
143142

144-
## Authenticate the client
143+
### Authenticate the client
145144

146145
> [!NOTE]
147-
> This quickstart assumes you've [created an environment variable](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account#configure-an-environment-variable-for-authentication) for your Bing Autosuggest key, named `AUTOSUGGEST_SUBSCRIPTION_KEY`, and one for your endpoint named `AUTOSUGGEST_ENDPOINT`.
146+
> This quickstart assumes you've [created an environment variable](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account#configure-an-environment-variable-for-authentication) for your Bing Autosuggest key, named `AUTOSUGGEST_SUBSCRIPTION_KEY`, and one for your endpoint, named `AUTOSUGGEST_ENDPOINT`.
148147
149148

150149
In a new asynchronous method, instantiate a client with your endpoint and key. Create an [ApiKeyServiceClientCredentials](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.search.autosuggest.apikeyserviceclientcredentials?view=azure-dotnet) object with your key, and use it with your endpoint to create an [AutosuggestClient](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.search.autosuggest.autosuggestclient?view=azure-dotnet) object.
@@ -161,9 +160,9 @@ async static Task RunQuickstart()
161160
}
162161
```
163162

164-
## Send an autosuggest request
163+
### Send an Autosuggest request
165164

166-
In the same method, use the client's [AutoSuggestMethodAsync](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.search.autosuggest.autosuggestclientextensions.autosuggestmethodasync?view=azure-dotnet#Microsoft_Azure_CognitiveServices_Search_AutoSuggest_AutoSuggestClientExtensions_AutoSuggestMethodAsync_Microsoft_Azure_CognitiveServices_Search_AutoSuggest_IAutoSuggestClient_System_String_System_String_System_String_System_String_System_String_System_String_System_String_System_String_System_String_System_String_System_String_System_Collections_Generic_IList_System_String__System_Threading_CancellationToken_) method to send a query to Bing. Then iterate over the [Suggestions](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.search.autosuggest.models.suggestions?view=azure-dotnet) response, and print the first suggestion.
165+
In the same method, use the client's [AutoSuggestMethodAsync](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.search.autosuggest.autosuggestclientextensions.autosuggestmethodasync?view=azure-dotnet#Microsoft_Azure_CognitiveServices_Search_AutoSuggest_AutoSuggestClientExtensions_AutoSuggestMethodAsync_Microsoft_Azure_CognitiveServices_Search_AutoSuggest_IAutoSuggestClient_System_String_System_String_System_String_System_String_System_String_System_String_System_String_System_String_System_String_System_String_System_String_System_Collections_Generic_IList_System_String__System_Threading_CancellationToken_) method to send a query to Bing. Then, iterate over the [Suggestions](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.search.autosuggest.models.suggestions?view=azure-dotnet) response, and print the first suggestion.
167166

168167
```csharp
169168
var result = await client.AutoSuggestMethodAsync("xb");
@@ -199,10 +198,10 @@ dotnet run
199198

200199
## Clean up resources
201200

202-
If you want to clean up and remove a Cognitive Services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.
201+
If you want to clean up and remove a Cognitive Services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it:
203202

204-
* [Portal](../../../cognitive-services-apis-create-account.md#clean-up-resources)
205-
* [Azure CLI](../../../cognitive-services-apis-create-account-cli.md#clean-up-resources)
203+
* [Delete a resource group in the Azure portal](../../../cognitive-services-apis-create-account.md#clean-up-resources).
204+
* [Delete a resource group in the Azure CLI](../../../cognitive-services-apis-create-account-cli.md#clean-up-resources).
206205

207206
## Next steps
208207

0 commit comments

Comments
 (0)