Skip to content

Commit 63ec331

Browse files
authored
Merge pull request #50 from wiazur/patch-10
Updated endpoint
2 parents 55d08b5 + 4df5b0d commit 63ec331

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

dotnet/ComputerVision/TagImage/Program.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.TagImage
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
TagImageSample.RunAsync(endpoint, subscriptionKey).Wait(5000);
@@ -27,8 +28,8 @@ public class TagImageSample
2728
public static async Task RunAsync(string endpoint, string key)
2829
{
2930
Console.WriteLine("Find tags of images:");
30-
31-
string imageFilePath = @"Images\landmark.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\landmark.jpg";
3233
string remoteImageUrl = "https://github.com/Azure-Samples/cognitive-services-sample-data-files/raw/master/ComputerVision/Images/objects.jpg";
3334

3435
await TagImageFromStreamAsync(imageFilePath, endpoint, key);

0 commit comments

Comments
 (0)