Skip to content

Commit b6a582f

Browse files
authored
Merge pull request #60 from wiazur/patch-20
Updated key/endpoint
2 parents 2abe4ac + 02a10aa commit b6a582f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

dotnet/Search/BingNewsSearchv7.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@ class Program
1616
// *** Update or verify the following values. ***
1717
// **********************************************
1818

19-
// Replace the accessKey string value with your valid access key.
20-
const string accessKey = "enter key here";
21-
22-
// Verify the endpoint URI. At this writing, only one endpoint is used for Bing
23-
// search APIs. In the future, regional endpoints may be available. If you
24-
// encounter unexpected authorization errors, double-check this value against
25-
// the endpoint for your Bing News search instance in your Azure dashboard.
26-
const string uriBase = "https://api.cognitive.microsoft.com/bing/v7.0/news/search";
19+
// Add your Azure Bing Search V7 subscription key to your environment variables.
20+
const string accessKey = Environment.GetEnvironmentVariable("BING_SEARCH_V7_SUBSCRIPTION_KEY");
21+
// Add your Azure Bing Search V7 endpoint to your environment variables.
22+
const string uriBase = Environment.GetEnvironmentVariable("BING_SEARCH_V7_ENDPOINT") + "/bing/v7.0/news/search";
2723

2824
const string searchTerm = "Microsoft";
2925

0 commit comments

Comments
 (0)