Skip to content

Commit 101c28f

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 101c28f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dotnet/Search/BingCustomSearchv7.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ class Program
1212
{
1313
static void Main(string[] args)
1414
{
15-
var subscriptionKey = "YOUR-SUBSCRIPTION-KEY";
15+
// Add your Azure Bing Custom Search subscription key to your environment variables.
16+
var subscriptionKey = Environment.GetEnvironmentVariable("BING_CUSTOM_SEARCH_SUBSCRIPTION_KEY");
1617
var customConfigId = "YOUR-CUSTOM-CONFIG-ID";
1718
var searchTerm = args.Length > 0 ? args[0]: "microsoft";
18-
19-
var url = "https://api.cognitive.microsoft.com/bingcustomsearch/v7.0/search?" +
19+
20+
// Add your Azure Bing Custom Search endpoint to your environment variables.
21+
var url = Environment.GetEnvironmentVariable("BING_CUSTOM_SEARCH_ENDPOINT") + "/bingcustomsearch/v7.0/search?" +
2022
"q=" + searchTerm +
2123
"&customconfig=" + customConfigId;
2224

0 commit comments

Comments
 (0)