Skip to content

Commit d69d8cd

Browse files
authored
Merge pull request #97717 from aahill/bing-setup-updates
[CogSvcs][Bing web search] updating setup instructions
2 parents c606057 + 0f22197 commit d69d8cd

File tree

12 files changed

+73
-42
lines changed

12 files changed

+73
-42
lines changed

articles/cognitive-services/Bing-Web-Search/quickstarts/csharp.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-web-search
1010
ms.topic: quickstart
11-
ms.date: 03/12/2019
11+
ms.date: 12/03/2019
1212
ms.author: aahi
1313
ms.custom: seodec2018
1414
#Customer intent: As a new developer, I want to make my first call to the Bing Web Search API and receive a response using C#.
@@ -28,6 +28,8 @@ Here are a few things that you'll need before running this quickstart:
2828

2929
This example program only uses .NET Core classes.
3030

31+
## Create a Bing Web Search resource
32+
3133
[!INCLUDE [bing-web-search-quickstart-signup](../../../../includes/bing-web-search-quickstart-signup.md)]
3234

3335
## Create a project and declare dependencies
@@ -58,7 +60,7 @@ namespace BingSearchApisQuickstart
5860

5961
## Define variables
6062

61-
A few variables must be set before we can continue. Confirm that the `uriBase` is valid and replace the `accessKey` value with a valid subscription key from your Azure account. Feel free to customize the search query by replacing the value for `searchTerm`. Remember to add this code to the `Program` class as noted above.
63+
A few variables must be set before we can continue. `uriBase` can be the global endpoint below, or the [custom subdomain](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains) endpoint displayed in the Azure portal for your resource. Replace the `accessKey` value with a valid subscription key from your Azure account. Feel free to customize the search query by replacing the value for `searchTerm`. Remember to add this code to the `Program` class as noted above.
6264

6365
```csharp
6466
// Enter a valid subscription key.

articles/cognitive-services/Bing-Web-Search/quickstarts/go.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-web-search
1010
ms.topic: quickstart
11-
ms.date: 03/12/2019
11+
ms.date: 12/03/2019
1212
ms.author: aahi
1313
ms.reviewer: [email protected], v-gedod, erhopf
1414
ms.custom: seodec2018
@@ -19,8 +19,6 @@ ms.custom: seodec2018
1919

2020
Use this quickstart to make your first call to the Bing Web Search API and receive the JSON response. This Go application sends a search request to the API, and shows the response. While this application is written in Go, the API is a RESTful Web service compatible with most programming languages.
2121

22-
See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
23-
2422
## Prerequisites
2523
Here are a few things that you'll need before running this quickstart:
2624

@@ -29,6 +27,8 @@ Here are a few things that you'll need before running this quickstart:
2927

3028
This quickstart only requires **core** libraries, there are no external dependencies.
3129

30+
## Create a Bing Web Search resource
31+
3232
[!INCLUDE [bing-web-search-quickstart-signup](../../../../includes/bing-web-search-quickstart-signup.md)]
3333

3434
## Create a project and import core libraries
@@ -109,7 +109,9 @@ type BingAnswer struct {
109109

110110
## Declare the main function and define variables
111111

112-
This code declares the main function and sets required variables. Confirm that the endpoint is correct and replace the `token` value with a valid subscription key from your Azure account. Feel free to customize the search query by replacing the value for `searchTerm`.
112+
This code declares the main function and sets required variables. `endpoint` can be the global endpoint below, or the [custom subdomain](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains) endpoint displayed in the Azure portal for your resource.
113+
114+
Confirm that the endpoint is correct and replace the `token` value with a valid subscription key from your Azure account. Feel free to customize the search query by replacing the value for `searchTerm`.
113115

114116
```go
115117
// Declare the main function. This is required for all Go programs.

articles/cognitive-services/Bing-Web-Search/quickstarts/java.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-web-search
1010
ms.topic: quickstart
11-
ms.date: 07/22/2019
11+
ms.date: 12/03/2019
1212
ms.author: aahi
1313
ms.custom: seodec2018, seo-java-july2019, seo-java-august2019, seo-java-september2019
1414
#Customer intent: As a new developer, I want to make my first call to the Bing Web Search API and receive a response using Java.
@@ -26,6 +26,8 @@ Here are a few things that you'll need before running this quickstart:
2626
* [Gson library](https://github.com/google/gson)
2727
* A subscription key
2828

29+
## Create a Bing Web Search resource
30+
2931
[!INCLUDE [bing-web-search-quickstart-signup](../../../../includes/bing-web-search-quickstart-signup.md)]
3032

3133
## Create a project and import dependencies
@@ -69,7 +71,9 @@ public class BingWebSearch {
6971

7072
## Define variables
7173

72-
This code sets the `subscriptionKey`, `host`, `path`, and `searchTerm`. Confirm that the endpoint is correct and replace the `subscriptionKey` value with a valid subscription key from your Azure account. Feel free to customize the search query by replacing the value for `searchTerm`. Remember to add this code to the `BingWebSearch` class as noted above.
74+
This code sets the `subscriptionKey`, `host`, `path`, and `searchTerm`. `host` can be the global endpoint below, or the [custom subdomain](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains) endpoint displayed in the Azure portal for your resource.
75+
76+
Confirm that the endpoint is correct and replace the `subscriptionKey` value with a valid subscription key from your Azure account. Feel free to customize the search query by replacing the value for `searchTerm`. Remember to add this code to the `BingWebSearch` class as noted above.
7377

7478
```java
7579
// Enter a valid subscription key.

articles/cognitive-services/Bing-Web-Search/quickstarts/nodejs.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-web-search
1010
ms.topic: quickstart
11-
ms.date: 03/12/2019
11+
ms.date: 12/03/2019
1212
ms.author: aahi
1313
ms.custom: seodec2018
1414
#Customer intent: As a new developer, I want to make my first call to the Bing Web Search API and receive a response using Node.js.
@@ -25,6 +25,8 @@ Here are a few things that you'll need before running this quickstart:
2525
* [Node.js 6](https://nodejs.org/en/download/) or later
2626
* A subscription key
2727

28+
## Create a Bing Web Search resource
29+
2830
[!INCLUDE [bing-web-search-quickstart-signup](../../../../includes/bing-web-search-quickstart-signup.md)]
2931

3032
## Create a project and declare required modules
@@ -53,7 +55,7 @@ if (!SUBSCRIPTION_KEY) {
5355

5456
## Create a function to make the request
5557

56-
This function will make a secure GET request, saving the search query as a query parameter in the path. `encodeURIComponent` is used to escape invalid characters, and the subscription key is passed in a header. The callback receives a [response](https://nodejs.org/dist/latest-v10.x/docs/api/http.html#http_class_http_serverresponse) that subscribes to the `data` event to aggregate the JSON body, the `error` event to log any issues, and the `end` event to know when the message should be considered complete. When complete, the app will print the interesting headers and message body. You can play with the colors and set the depth to suit your preference, a depth of `1` gives a nice summary of the response.
58+
This function will make a secure GET request, saving the search query as a query parameter in the path. `hostname` can be the global endpoint below, or the [custom subdomain](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains) endpoint displayed in the Azure portal for your resource. `encodeURIComponent` is used to escape invalid characters, and the subscription key is passed in a header. The callback receives a [response](https://nodejs.org/dist/latest-v10.x/docs/api/http.html#http_class_http_serverresponse) that subscribes to the `data` event to aggregate the JSON body, the `error` event to log any issues, and the `end` event to know when the message should be considered complete. When complete, the app will print the interesting headers and message body. You can play with the colors and set the depth to suit your preference, a depth of `1` gives a nice summary of the response.
5759

5860
```javascript
5961
function bingWebSearch(query) {

articles/cognitive-services/Bing-Web-Search/quickstarts/php.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-web-search
1010
ms.topic: quickstart
11-
ms.date: 03/12/2019
11+
ms.date: 12/03/2019
1212
ms.author: aahi
1313
ms.custom: seodec2018
1414
#Customer intent: As a new developer, I want to make my first call to the Bing Web Search API and receive a response using PHP.
@@ -25,6 +25,8 @@ Here are a few things that you'll need before running this quickstart:
2525
* [PHP 5.6.x](https://php.net/downloads.php) or later
2626
* A subscription key
2727

28+
## Create a Bing Web Search resource
29+
2830
[!INCLUDE [bing-web-search-quickstart-signup](../../../../includes/bing-web-search-quickstart-signup.md)]
2931

3032
## Enable secure HTTP support
@@ -39,7 +41,7 @@ Before we get started, locate `php.ini` and uncomment this line:
3941

4042
Create a new PHP project in your favorite IDE or editor. Don't forget to add opening and closing tags `<?php` and `?>`.
4143

42-
A few variables must be set before we can continue. Confirm that the `$endpoint` is correct and replace the `$accesskey` value with a valid subscription key from your Azure account. Feel free to customize the search query by replacing the value for `$term`.
44+
A few variables must be set before we can continue. `$endpoint` can be the global endpoint below, or the [custom subdomain](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains) endpoint displayed in the Azure portal for your resource. Confirm that the `$endpoint` is correct and replace the `$accesskey` value with a valid subscription key from your Azure account. Feel free to customize the search query by replacing the value for `$term`.
4345

4446
```php
4547
$accessKey = 'enter key here';

articles/cognitive-services/Bing-Web-Search/quickstarts/python.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-web-search
1010
ms.topic: quickstart
11-
ms.date: 03/12/2019
11+
ms.date: 12/03/2019
1212
ms.author: aahi
1313
ms.custom: seodec2018
1414
#Customer intent: As a new developer, I want to make my first call to the Bing Web Search API and receive a response using Python.
@@ -26,6 +26,8 @@ This example is run as a Jupyter notebook on [MyBinder](https://mybinder.org). S
2626

2727
* [Python 2.x or 3.x](https://www.python.org/)
2828

29+
## Create a Bing Web Search resource
30+
2931
[!INCLUDE [bing-web-search-quickstart-signup](../../../../includes/bing-web-search-quickstart-signup.md)]
3032

3133
## Define variables
@@ -37,7 +39,7 @@ subscription_key = "YOUR_ACCESS_KEY"
3739
assert subscription_key
3840
```
3941

40-
Declare the Bing Web Search API endpoint. If you run into any authorization errors, double-check this value against the Bing search endpoint in your Azure dashboard.
42+
Declare the Bing Web Search API endpoint. It can be the global endpoint below, or the [custom subdomain](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains) endpoint displayed in the Azure portal for your resource..
4143

4244
```python
4345
search_url = "https://api.cognitive.microsoft.com/bing/v7.0/search"

articles/cognitive-services/Bing-Web-Search/quickstarts/ruby.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-web-search
1010
ms.topic: quickstart
11-
ms.date: 03/12/2019
11+
ms.date: 12/03/2019
1212
ms.author: aahi
1313
ms.custom: seodec2018
1414
#Customer intent: As a new developer, I want to make my first call to the Bing Web Search API and receive a response using Ruby.
@@ -25,6 +25,8 @@ Here are a few things that you'll need before running this quickstart:
2525
* [Ruby 2.4 or later](https://www.ruby-lang.org/en/downloads/)
2626
* A subscription key
2727

28+
## Create a Bing Web Search resource
29+
2830
[!INCLUDE [bing-web-search-quickstart-signup](../../../../includes/bing-web-search-quickstart-signup.md)]
2931

3032
## Create a project and declare required modules
@@ -39,7 +41,7 @@ require 'json'
3941

4042
## Define variables
4143

42-
A few variables must be set before we can continue. Confirm that the `$uri` and `path` are valid and replace the `accessKey` value with a valid subscription key from your Azure account. Feel free to customize the search query by replacing the value for `term`.
44+
A few variables must be set before we can continue. `uri` can be the global endpoint below, or the [custom subdomain](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains) endpoint displayed in the Azure portal for your resource. Confirm that the `uri` and `path` are valid and replace the `accessKey` value with a valid subscription key from your Azure account. Feel free to customize the search query by replacing the value for `term`.
4345

4446
```ruby
4547
accessKey = "YOUR_SUBSCRIPTION_KEY"

articles/cognitive-services/Bing-Web-Search/web-sdk-java-quickstart.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-web-search
1010
ms.topic: quickstart
11-
ms.date: 07/25/2019
11+
ms.date: 12/03/2019
1212
ms.author: aahi
1313
---
1414

@@ -18,10 +18,6 @@ The Bing Web Search SDK makes it easy to integrate Bing Web Search into your Jav
1818

1919
Want to see the code right now? The [Bing Web Search SDK for Java samples](https://github.com/Azure-Samples/cognitive-services-java-sdk-samples/) are available on GitHub.
2020

21-
[!INCLUDE [bing-web-search-quickstart-signup](../../../includes/bing-web-search-quickstart-signup.md)]
22-
23-
See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
24-
2521
## Prerequisites
2622

2723
Here are a few things that you'll need before running this quickstart:
@@ -30,6 +26,10 @@ Here are a few things that you'll need before running this quickstart:
3026
* [Apache Maven](https://maven.apache.org/download.cgi) or your favorite build automation tool
3127
* A subscription key
3228

29+
## Create a Bing Web Search resource
30+
31+
[!INCLUDE [bing-web-search-quickstart-signup](../../../includes/bing-web-search-quickstart-signup.md)]
32+
3333
## Create a project and set up your POM file
3434

3535
Create a new Java project using Maven or your favorite build automation tool. Assuming that you're using Maven, add the following lines to your [Project Object Model (POM)](https://maven.apache.org/guides/introduction/introduction-to-the-pom.html) file. Replace all instances of `mainClass` with your application.

articles/cognitive-services/Bing-Web-Search/web-sdk-python-quickstart.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-web-search
1010
ms.topic: quickstart
11-
ms.date: 03/12/2019
11+
ms.date: 12/03/2019
1212
ms.author: aahi
1313
---
1414

@@ -18,17 +18,19 @@ The Bing Web Search SDK makes it easy to integrate Bing Web Search into your Pyt
1818

1919
Want to see the code right now? The [Bing Web Search SDK for Python samples](https://github.com/Azure-Samples/cognitive-services-python-sdk-samples) are available on GitHub.
2020

21-
[!INCLUDE [bing-web-search-quickstart-signup](../../../includes/bing-web-search-quickstart-signup.md)]
22-
23-
See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
24-
2521
## Prerequisites
22+
2623
The Bing Web Search SDK is compatible with Python 2.7, 3.3, 3.4, 3.5, and 3.6. We recommend using a virtual environment for this quickstart.
2724

2825
* Python 2.7, 3.3, 3.4, 3.5 or 3.6
2926
* [virtualenv](https://docs.python.org/3/tutorial/venv.html) for Python 2.7
3027
* [venv](https://pypi.python.org/pypi/virtualenv) for Python 3.x
3128

29+
## Create a Bing Web Search resource
30+
31+
[!INCLUDE [bing-web-search-quickstart-signup](../../../includes/bing-web-search-quickstart-signup.md)]
32+
33+
3234
## Create and configure your virtual environment
3335

3436
The instructions to set up and configure a virtual environment are different for Python 2.x and Python 3.x. Follow the steps below to create and initialize your virtual environment.
@@ -161,7 +163,7 @@ If the response contains web pages, images, news, or videos, the first result fo
161163

162164
1. Replace `SUBSCRIPTION_KEY` with a valid subscription key.
163165

164-
1. Replace `YOUR_ENDPOINT` with your endpoint url in portal.
166+
1. Replace `YOUR_ENDPOINT` with your endpoint url. You can use the Bing global endpoint, or the [custom subdomain](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains) endpoint displayed in the Azure portal for your resource.
165167

166168
1. Run the program. For example: `python your_program.py`.
167169

articles/cognitive-services/Bing-Web-Search/web-search-sdk-node-quickstart.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-web-search
1010
ms.topic: quickstart
11-
ms.date: 03/12/2019
11+
ms.date: 12/03/2019
1212
ms.author: aahi
1313
---
1414

@@ -18,16 +18,16 @@ The Bing Web Search SDK makes it easy to integrate Bing Web Search into your Nod
1818

1919
Want to see the code right now? The [Bing Web Search SDK for Node.js samples](https://github.com/Azure-Samples/cognitive-services-node-sdk-samples) are available on GitHub.
2020

21-
[!INCLUDE [bing-web-search-quickstart-signup](../../../includes/bing-web-search-quickstart-signup.md)]
22-
23-
See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
24-
2521
## Prerequisites
2622
Here are a few things that you'll need before running this quickstart:
2723

2824
* [Node.js 6](https://nodejs.org/en/download/) or later
2925
* A subscription key
3026

27+
## Create a Bing Web Search resource
28+
29+
[!INCLUDE [bing-web-search-quickstart-signup](../../../includes/bing-web-search-quickstart-signup.md)]
30+
3131
## Set up your development environment
3232

3333
Let's start by setting up the development environment for our Node.js project.

0 commit comments

Comments
 (0)