Skip to content

Commit b5e3d12

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 b5e3d12

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dotnet/Search/BingImageSearchPostv7.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ namespace ConsoleAppPost
1111
// For more information, see https://docs.microsoft.com/en-us/azure/cognitive-services/bing-image-search/tutorial-image-post
1212
class Program
1313
{
14-
// Replace the accessKey string value with your valid access key.
15-
const string accessKey = "YOUR-ACCESS-KEY";
14+
// Add your Azure Bing Search V7 subscription key to your environment variables.
15+
const string accessKey = Environment.GetEnvironmentVariable("BING_SEARCH_V7_SUBSCRIPTION_KEY");
1616

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

2020
// The image to upload. Replace with your file and path.
2121
const string imageFile = @"C:\Users\USER\PATH\IMAGE.jpg";

0 commit comments

Comments
 (0)