Skip to content

Commit 4b021d8

Browse files
authored
Merge pull request #43 from wiazur/patch-3
Updated endpoint
2 parents 13af406 + d268b10 commit 4b021d8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

dotnet/ComputerVision/DescribeImage/Program.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.DescribeImage
1010

1111
class Program
1212
{
13-
public const string subscriptionKey = "<your training key here>"; //Insert your Cognitive Services subscription key here
14-
public const string endpoint = "https://westus.api.cognitive.microsoft.com"; // You must use the same Azure region that you generated your subscription keys for. Free trial subscription keys are generated in the westus region.
15-
13+
// Add your Azure Computer Vision subscription key and endpoint to your environment variables
14+
public const string subscriptionKey = Environment.GetEnvironmentVariable("COMPUTER_VISION_SUBSCRIPTION_KEY");
15+
public const string endpoint = Environment.GetEnvironmentVariable("COMPUTER_VISION_ENDPOINT");
16+
1617
static void Main(string[] args)
1718
{
1819
DescribeImageSample.RunAsync(endpoint, subscriptionKey).Wait(5000);
19-
20+
2021
Console.WriteLine("\nPress ENTER to exit.");
2122
Console.ReadLine();
2223
}
@@ -27,8 +28,8 @@ public class DescribeImageSample
2728
public static async Task RunAsync(string endpoint, string key)
2829
{
2930
Console.WriteLine("Describe an image:");
30-
31-
string imageFilePath = @"Images\objects.jpg"; // See this repo's readme.md for info on how to get these images. Alternatively, you can just set the path to any appropriate image on your machine.
31+
// See this repo's readme.md for info on how to get these images. Or, set the path to any appropriate image on your machine.
32+
string imageFilePath = @"Images\objects.jpg";
3233
string remoteImageUrl = "https://github.com/Azure-Samples/cognitive-services-sample-data-files/raw/master/ComputerVision/Images/celebrities.jpg";
3334

3435
await DescribeImageFromStreamAsync(imageFilePath, endpoint, key);

0 commit comments

Comments
 (0)