From 4df5b0df5ae7a4c7717f8d7b33f150a222bfe935 Mon Sep 17 00:00:00 2001 From: Winona Azure <38537084+wiazur@users.noreply.github.com> Date: Thu, 29 Aug 2019 18:49:39 -0700 Subject: [PATCH] Updated endpoint --- dotnet/ComputerVision/TagImage/Program.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dotnet/ComputerVision/TagImage/Program.cs b/dotnet/ComputerVision/TagImage/Program.cs index 717df18..e69a326 100644 --- a/dotnet/ComputerVision/TagImage/Program.cs +++ b/dotnet/ComputerVision/TagImage/Program.cs @@ -10,9 +10,10 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.TagImage class Program { - public const string subscriptionKey = ""; //Insert your Cognitive Services subscription key here - 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. - + // Add your Azure Computer Vision subscription key and endpoint to your environment variables + public const string subscriptionKey = Environment.GetEnvironmentVariable("COMPUTER_VISION_SUBSCRIPTION_KEY"); + public const string endpoint = Environment.GetEnvironmentVariable("COMPUTER_VISION_ENDPOINT"); + static void Main(string[] args) { TagImageSample.RunAsync(endpoint, subscriptionKey).Wait(5000); @@ -27,8 +28,8 @@ public class TagImageSample public static async Task RunAsync(string endpoint, string key) { Console.WriteLine("Find tags of images:"); - - 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. + // 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. + string imageFilePath = @"Images\landmark.jpg"; string remoteImageUrl = "https://github.com/Azure-Samples/cognitive-services-sample-data-files/raw/master/ComputerVision/Images/objects.jpg"; await TagImageFromStreamAsync(imageFilePath, endpoint, key);