Skip to content

Commit 49f7472

Browse files
authored
Merge pull request #98219 from aahill/bing-setup-updates-2
[CogSvcs][Bing Image Search] Setup updates
2 parents 224d218 + ab0e2a3 commit 49f7472

25 files changed

+92
-109
lines changed

articles/cognitive-services/Bing-Image-Search/image-sdk-java-quickstart.md

Lines changed: 1 addition & 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-image-search
1010
ms.topic: quickstart
11-
ms.date: 08/26/2019
11+
ms.date: 12/06/2019
1212
ms.author: aahi
1313
ms.custom: seodec2018
1414
---
@@ -20,7 +20,6 @@ Use this quickstart to make your first image search using the Bing Image Search
2020
The source code for this sample is available [on GitHub](https://github.com/Azure-Samples/cognitive-services-java-sdk-samples/tree/master/Search/BingImageSearch/Quickstart) with additional error handling and annotations.
2121

2222
## Prerequisites
23-
Get a [Cognitive Services access key](https://azure.microsoft.com/try/cognitive-services/) under **Search**. See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
2423

2524
The latest version of the [Java Development Kit](https://aka.ms/azure-jdks) (JDK)
2625

articles/cognitive-services/Bing-Image-Search/image-sdk-python-quickstart.md

Lines changed: 1 addition & 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-image-search
1010
ms.topic: quickstart
11-
ms.date: 08/26/2019
11+
ms.date: 12/06/2019
1212
ms.author: aahi
1313
ms.custom: seodec2018
1414
---
@@ -19,7 +19,6 @@ Use this quickstart to make your first image search using the Bing Image Search
1919
The source code for this sample is available [on GitHub](https://github.com/Azure-Samples/cognitive-services-python-sdk-samples/blob/master/samples/search/image-search-quickstart.py) with additional error handling and annotations.
2020

2121
## Prerequisites
22-
Get a [Cognitive Services access key](https://azure.microsoft.com/try/cognitive-services/) under **Search**. See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
2322

2423
* [Python 2.7 or 3.4](https://www.python.org/) and higher.
2524

articles/cognitive-services/Bing-Image-Search/image-search-sdk-node-quickstart.md

Lines changed: 1 addition & 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-image-search
1010
ms.topic: quickstart
11-
ms.date: 08/26/2019
11+
ms.date: 12/06/2019
1212
ms.author: aahi
1313
ms.custom: seodec2018
1414
---
@@ -20,7 +20,6 @@ Use this quickstart to make your first image search using the Bing Image Search
2020
The source code for this sample is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-node-sdk-samples/blob/master/Samples/imageSearch.js) with additional error handling and annotations.
2121

2222
## Prerequisites
23-
Get a [Cognitive Services access key](https://azure.microsoft.com/try/cognitive-services/) under **Search**. See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/). See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
2423

2524
* The [Cognitive Services Image Search SDK for Node.js](https://www.npmjs.com/package/azure-cognitiveservices-imagesearch)
2625
* Install using `npm install azure-cognitiveservices-imagesearch`

articles/cognitive-services/Bing-Image-Search/image-search-sdk-quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: bing-image-search
1010
ms.topic: quickstart
11-
ms.date: 08/26/2019
11+
ms.date: 12/06/2019
1212
ms.author: aahi
1313
ms.custom: seodec2018
1414
---

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

Lines changed: 2 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-image-search
1010
ms.topic: quickstart
11-
ms.date: 08/26/2019
11+
ms.date: 12/06/2019
1212
ms.author: aahi
1313
---
1414
# Quickstart: Search for images using the Bing Image Search REST API and C#
@@ -36,7 +36,7 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
3636
using Newtonsoft.Json.Linq;
3737
```
3838

39-
2. Create variables for the API endpoint, your subscription key, and search term.
39+
2. Create variables for the API endpoint, your subscription key, and search term. `uriBase` can be the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
4040

4141
```csharp
4242
//...

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-image-search
1111
ms.topic: quickstart
12-
ms.date: 07/22/2019
12+
ms.date: 12/06/2019
1313
ms.author: aahi
1414
ms.custom: seodec2018, seo-java-july2019, seo-java-august2019, seo-java-september2019
1515
---
@@ -42,7 +42,7 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
4242
import com.google.gson.JsonParser;
4343
```
4444

45-
2. Create variables for the API endpoint, your subscription key, and search term.
45+
2. Create variables for the API endpoint, your subscription key, and search term. `host` can be the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
4646

4747
```java
4848
static String subscriptionKey = "enter key here";

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-image-search
1111
ms.topic: quickstart
12-
ms.date: 08/26/2019
12+
ms.date: 12/06/2019
1313
ms.author: aahi
1414
ms.custom: seodec2018
1515
---
@@ -25,7 +25,8 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
2525
* The latest version of [Node.js](https://nodejs.org/en/download/).
2626

2727
* The [JavaScript Request Library](https://github.com/request/request)
28-
[!INCLUDE [cognitive-services-bing-image-search-signup-requirements](../../../../includes/cognitive-services-bing-image-search-signup-requirements.md)]
28+
29+
[!INCLUDE [cognitive-services-bing-image-search-signup-requirements](../../../../includes/cognitive-services-bing-image-search-signup-requirements.md)]
2930

3031
See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.com/pricing/details/cognitive-services/search-api/).
3132

@@ -38,7 +39,8 @@ See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.
3839
let https = require('https');
3940
```
4041

41-
2. Create variables for the API endpoint, image API search path, your subscription key, and search term.
42+
2. Create variables for the API endpoint, image API search path, your subscription key, and search term. `host` can be the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
43+
4244
```javascript
4345
let subscriptionKey = 'enter key here';
4446
let host = 'api.cognitive.microsoft.com';

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-image-search
1111
ms.topic: quickstart
12-
ms.date: 8/26/2019
12+
ms.date: 12/06/2019
1313
ms.author: aahi
1414
ms.custom: seodec2018
1515
---
@@ -35,15 +35,16 @@ To run this application, follow these steps.
3535

3636
1. Make sure secure HTTP support is enabled in your `php.ini` file. On Windows, this file is located in `C:\windows`.
3737
2. Create a new PHP project in your favorite IDE or editor.
38-
3. define the API endpoint, your subscription key, and search term.
38+
3. Define the API endpoint, your subscription key, and search term. the endpoint can be the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
3939

4040
```php
4141
$endpoint = 'https://api.cognitive.microsoft.com/bing/v7.0/images/search';
4242
// Replace the accessKey string value with your valid access key.
4343
$accessKey = 'enter key here';
4444
$term = 'tropical ocean';
4545
```
46-
## Construct and perform an HTTP request
46+
47+
## Construct and perform an HTTP request
4748

4849
1. Use the variables from the last step to prepare an HTTP request to the Image Search API.
4950

@@ -53,6 +54,7 @@ To run this application, follow these steps.
5354
'header' => $headers,
5455
'method' => 'GET' ));
5556
```
57+
5658
2. Send the web request and get the JSON response.
5759

5860
```php
@@ -64,16 +66,16 @@ To run this application, follow these steps.
6466

6567
Process and print the returned JSON response.
6668

67-
```php
68-
$headers = array();
69-
foreach ($http_response_header as $k => $v) {
70-
$h = explode(":", $v, 2);
71-
if (isset($h[1]))
72-
if (preg_match("/^BingAPIs-/", $h[0]) || preg_match("/^X-MSEdge-/", $h[0]))
73-
$headers[trim($h[0])] = trim($h[1]);
74-
}
75-
return array($headers, $result);
76-
```
69+
```php
70+
$headers = array();
71+
foreach ($http_response_header as $k => $v) {
72+
$h = explode(":", $v, 2);
73+
if (isset($h[1]))
74+
if (preg_match("/^BingAPIs-/", $h[0]) || preg_match("/^X-MSEdge-/", $h[0]))
75+
$headers[trim($h[0])] = trim($h[1]);
76+
}
77+
return array($headers, $result);
78+
```
7779

7880
## Example JSON response
7981

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

Lines changed: 2 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-image-search
1010
ms.topic: quickstart
11-
ms.date: 08/26/2019
11+
ms.date: 12/06/2019
1212
ms.author: aahi
1313
ms.custom: seodec2018
1414
---
@@ -35,7 +35,7 @@ The source code for this sample is available [on GitHub](https://github.com/Azur
3535

3636
## Create and initialize the application
3737

38-
1. Create a new Python file in your favorite IDE or editor, and import the following modules. Create a variable for your subscription key, search endpoint, and search term.
38+
1. Create a new Python file in your favorite IDE or editor, and import the following modules. Create a variable for your subscription key, search endpoint, and search term. `search_url` can be the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
3939

4040
```python
4141
import requests

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: bing-image-search
1111
ms.topic: quickstart
12-
ms.date: 03/04/2019
12+
ms.date: 12/06/2019
1313
ms.author: aahi
1414
ms.custom: seodec2018
1515
---
@@ -38,7 +38,7 @@ See also [Cognitive Services Pricing - Bing Search API](https://azure.microsoft.
3838
require 'json'
3939
```
4040

41-
2. Create variables for the API endpoint, image API search path, your subscription key, and search term.
41+
2. Create variables for the API endpoint, image API search path, your subscription key, and search term. `uri` can be the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
4242

4343
```ruby
4444
uri = "https://api.cognitive.microsoft.com"

0 commit comments

Comments
 (0)