Skip to content

Commit c7b1260

Browse files
authored
Updated key
1 parent fedf5a4 commit c7b1260

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

Search/BingNewsSearch/src/main/java/com/microsoft/azure/cognitiveservices/search/newssearch/samples/BingNewsSearchSample.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,12 @@ public static void main(String[] args) {
145145
try {
146146
//=============================================================
147147
// Authenticate
148-
149-
// If you are going to set the AZURE_BING_SAMPLES_API_KEY environment variable, make sure you set it for your OS, then reopen your command prompt or IDE.
150-
// If not, you may get an API key not found exception.
151-
// IMPORTANT: if you have not set the `AZURE_BING_SAMPLES_API_KEY` environment variable to your cognitive services API key:
152-
// 1. comment out the below line
153-
final String subscriptionKey = System.getenv("AZURE_BING_SAMPLES_API_KEY");
154-
// 2. paste your cognitive services API key below, and uncomment the line
155-
//final String subscriptionKey = "enter your key here";
148+
// Set the BING_SEARCH_V7_SUBSCRIPTION_KEY environment variable with your subscription key,
149+
// then reopen your command prompt or IDE. If not, you may get an API key not found exception.
150+
final String subscriptionKey = System.getenv("BING_SEARCH_V7_SUBSCRIPTION_KEY");
156151

157152
BingNewsSearchAPI bingNewsSearchAPIClient = BingNewsSearchManager.authenticate(subscriptionKey);
158153

159-
160154
runSample(bingNewsSearchAPIClient);
161155
} catch (Exception e) {
162156
System.out.println(e.getMessage());

0 commit comments

Comments
 (0)