Skip to content

Commit 7bda4d1

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 7bda4d1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

java/Search/BingVisualSearchv7.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636

3737
public class UploadImage2 {
3838

39-
static String endpoint = "https://api.cognitive.microsoft.com/bing/v7.0/images/visualsearch";
40-
static String subscriptionKey = "<yoursubscriptionkeygoeshere";
39+
// Add your Bing Search V7 endpoint to your environment variables.
40+
static String endpoint = System.getenv("BING_SEARCH_V7_ENDPOINT") + "/bing/v7.0/images/visualsearch";
41+
// Add your Bing Search V7 subscription key to your environment variables.
42+
static String subscriptionKey = System.getenv("BING_SEARCH_V7_SUBSCRIPTION_KEY");
4143
static String imagePath = "<pathtoyourimagetouploadgoeshere>";
4244

4345
/**
@@ -83,4 +85,4 @@ public static String prettify(String json_text) {
8385
return gson.toJson(json);
8486
}
8587

86-
}
88+
}

0 commit comments

Comments
 (0)