From cb0182d0a46fc92cadfe0cc325ad80a41a06ab43 Mon Sep 17 00:00:00 2001 From: Winona Azure <38537084+wiazur@users.noreply.github.com> Date: Tue, 3 Sep 2019 17:27:56 -0700 Subject: [PATCH] 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. --- java/Search/BingSpellCheckv7.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/java/Search/BingSpellCheckv7.java b/java/Search/BingSpellCheckv7.java index ee0ba02..3f80345 100644 --- a/java/Search/BingSpellCheckv7.java +++ b/java/Search/BingSpellCheckv7.java @@ -4,11 +4,12 @@ public class HelloWorld { - static String host = "https://api.cognitive.microsoft.com"; + // Add your Bing Spell Check subscription key to your environment variables. + static String host = System.getenv("BING_SPELL_CHECK_ENDPOINT"); static String path = "/bing/v7.0/spellcheck"; - // NOTE: Replace this example key with a valid subscription key. - static String key = "ENTER KEY HERE"; + // Add your Bing Spell Check endpoint to your environment variables. + static String key = System.getenv("BING_SPELL_CHECK_SUBSCRIPTION_KEY"); static String mkt = "en-US"; static String mode = "proof"; @@ -46,4 +47,4 @@ public static void main(String[] args) { System.out.println (e); } } -} \ No newline at end of file +}