Skip to content

Commit 2abe4ac

Browse files
authored
Merge pull request #59 from wiazur/patch-19
Updated key/endpoint
2 parents 860483b + 27c0f4b commit 2abe4ac

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

dotnet/Search/BingImageSearchv7Quickstart.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ namespace BingSearchApisQuickstart
1313
class Program
1414
{
1515

16-
// Replace this string value with your valid access key.
17-
const string subscriptionKey = "Enter your subscription key here";
16+
// Add your Azure Bing Search V7 subscription key to your environment variables
17+
const string subscriptionKey = Environment.GetEnvironmentVariable("BING_SEARCH_V7_SUBSCRIPTION_KEY");
1818

19-
// Verify the endpoint URI. If you encounter unexpected authorization errors,
20-
// double-check this value against the Bing search endpoint in your Azure dashboard.
21-
const string uriBase = "https://api.cognitive.microsoft.com/bing/v7.0/images/search";
19+
// Add your Azure Bing Search V7 endpoint to your environment variables
20+
const string uriBase = Environment.GetEnvironmentVariable("BING_SEARCH_V7_ENDPOINT") + "/bing/v7.0/images/search";
2221

2322
const string searchTerm = "tropical ocean";
2423

0 commit comments

Comments
 (0)