Skip to content

Commit 0e0e974

Browse files
authored
Updated key/endpoint
Endpoints are not region-based anymore, but rather custom domain -based. Although regional endpoints will still work. Also, the authentication information is moving to a standard of getting it from environment variables.
1 parent 0d20f1e commit 0e0e974

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

python/Search/BingNewsSearchv7.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
# *** Update or verify the following values. ***
1010
# **********************************************
1111

12-
# Replace the subscriptionKey string value with your valid subscription key.
13-
subscriptionKey = "enter key here"
14-
15-
# Verify the endpoint URI. At this writing, only one endpoint is used for Bing
16-
# search APIs. In the future, regional endpoints may be available. If you
17-
# encounter unexpected authorization errors, double-check this value against
18-
# the endpoint for your Bing search instance in your Azure dashboard.
19-
host = "api.cognitive.microsoft.com"
12+
# Add your Bing Search V7 subscription key to your environment variables.
13+
subscriptionKey = os.environ['BING_SEARCH_V7_SUBSCRIPTION_KEY']
14+
15+
# Add your Bing Search V7 endpoint to your environment variables.
16+
host = os.environ['BING_SEARCH_V7_ENDPOINT']
2017
path = "/bing/v7.0/news/search"
2118

2219
term = "Microsoft"

0 commit comments

Comments
 (0)