diff --git a/dotnet/ComputerVision/RecognizeDomainSpecificContent/Program.cs b/dotnet/ComputerVision/RecognizeDomainSpecificContent/Program.cs index 90d0915..99ec735 100644 --- a/dotnet/ComputerVision/RecognizeDomainSpecificContent/Program.cs +++ b/dotnet/ComputerVision/RecognizeDomainSpecificContent/Program.cs @@ -10,9 +10,11 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.RecognizeDoma 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) { RecognizeDomainSpecificContentSample.RunAsync(endpoint, subscriptionKey).Wait(5000); @@ -27,8 +29,8 @@ public class RecognizeDomainSpecificContentSample public static async Task RunAsync(string endpoint, string key) { Console.WriteLine("Recognize domain specific content (celebrities/landmarks) in 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/celebrities.jpg"; await RecognizeDomainSpecificContentFromUrlAsync(remoteImageUrl, endpoint, key, "celebrities");