Skip to content

Commit c4ef2dc

Browse files
authored
Updated key
Changing all authentication variables to environment variables with standard naming. <SERVICE>_SUBSCRIPTION_KEY
1 parent 1d781cd commit c4ef2dc

File tree

1 file changed

+4
-4
lines changed
  • Search/BingImageSearch/Quickstart/src/main/java/com/microsoft/azure/cognitiveservices/search/imagesearch/samples

1 file changed

+4
-4
lines changed

Search/BingImageSearch/Quickstart/src/main/java/com/microsoft/azure/cognitiveservices/search/imagesearch/samples/BingImageSearchSample.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ public static void main(String[] args) {
6464
try {
6565
// Authenticate
6666

67-
// 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.
67+
// If you are going to set the BING_SEARCH_V7_SUBSCRIPTION_KEY environment variable, make sure you set it for your OS, then reopen your command prompt or IDE.
6868
// If not, you may get an API key not found exception.
69-
// IMPORTANT: if you have not set the `AZURE_BING_SAMPLES_API_KEY` environment variable to your cognitive services API key:
69+
// IMPORTANT: if you have not set the BING_SEARCH_V7_SUBSCRIPTION_KEY environment variable to your cognitive services API key:
7070
// 1. comment out the below line
71-
final String subscriptionKey = System.getenv("AZURE_BING_SAMPLES_API_KEY");
71+
final String subscriptionKey = System.getenv("BING_SEARCH_V7_SUBSCRIPTION_KEY");
7272
// 2. paste your cognitive services API key below, and uncomment the line
73-
//final String subscriptionKey = "enter your key here";
73+
//final String subscriptionKey = System.getenv("BING_SEARCH_V7_SUBSCRIPTION_KEY");
7474

7575
BingImageSearchAPI client = BingImageSearchManager.authenticate(subscriptionKey);
7676
String searchTerm = "canadian rockies";

0 commit comments

Comments
 (0)