Skip to content

Commit 03a4090

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 03a4090

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dotnet/Search/BingImageSearchInsightsTutorial.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ namespace ConsoleAppPost
77
{
88
class Program
99
{
10-
// Replace the accessKey string value with your valid access key.
11-
const string accessKey = "enter key here";
10+
// Add your Azure Bing Search v7 subscription key to your environment variables
11+
const string accessKey = Environment.GetEnvironmentVariable("BING_SEARCH_V7_SUBSCRIPTION_KEY");
1212

13-
// The endpoint URI.
14-
const string uriBase = "https://api.cognitive.microsoft.com/bing/v7.0/images/details";
13+
// Add your Azure Bing Search v7 endpoint to your environment variables
14+
const string uriBase = Environment.GetEnvironmentVariable("BING_SEARCH_V7_ENDPOINT") + "/bing/v7.0/images/details";
1515

1616
// The image to upload. Replace with your file and path.
1717
const string imageFile = "your-image-file.jpg";
@@ -144,4 +144,4 @@ static string JsonPrettyPrint(string json)
144144
return sb.ToString().Trim();
145145
}
146146
}
147-
}
147+
}

0 commit comments

Comments
 (0)