Skip to content

Commit c05c8fe

Browse files
authored
Updated key
Changing all authentication variables to environment variables with standard naming.
1 parent aacedb5 commit c05c8fe

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Search/BingVisualSearch/src/main/java/com/microsoft/azure/cognitiveservices/search/visualsearch/samples/BingVisualSearchSample.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,11 @@ public static void main(String[] args) {
192192
try {
193193
//=============================================================
194194
// Authenticate
195-
196-
// 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.
197-
// If not, you may get an API key not found exception.
198-
// IMPORTANT: MAKE SURE TO USE S9 PRICING TIER OF THE BING SEARCH V7 API KEY FOR VISUAL SEARCH. Otherwise, you will get an invalid subscription key error.
199-
// IMPORTANT: if you have not set the `AZURE_BING_SAMPLES_API_KEY` environment variable to your cognitive services API key:
200-
// 1. comment out the below line
201-
final String subscriptionKey = System.getenv("AZURE_BING_SAMPLES_API_KEY");
202-
// 2. paste your cognitive services API key below, and uncomment the line
203-
//final String subscriptionKey = "enter your key here";
195+
// Set the BING_SEARCH_V7_SUBSCRIPTION_KEY environment variable with your subscription key,
196+
// then reopen your command prompt or IDE. If not, you may get an API key not found exception.
197+
// IMPORTANT: MAKE SURE TO USE S9 PRICING TIER OF THE BING SEARCH V7 API KEY FOR VISUAL SEARCH.
198+
// Otherwise, you will get an invalid subscription key error.
199+
final String subscriptionKey = System.getenv("BING_SEARCH_V7_SUBSCRIPTION_KEY");
204200

205201
BingVisualSearchAPI client = BingVisualSearchManager.authenticate(subscriptionKey);
206202

0 commit comments

Comments
 (0)