Skip to content

Commit df0c290

Browse files
authored
Updated endpoint
1 parent 0d20f1e commit df0c290

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

dotnet/ComputerVision/AnalyzeImage/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.AnalyzeImage
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
AnalyzeImageSample.RunAsync(endpoint, subscriptionKey).Wait(6000);
@@ -26,8 +27,8 @@ public class AnalyzeImageSample
2627
public static async Task RunAsync(string endpoint, string key)
2728
{
2829
Console.WriteLine("Images being analyzed:");
29-
30-
string imageFilePath = @"Images\faces.jpg"; // See this repo's readme.md for info on how to get these images. Alternatively, you can just set the path to any image on your machine.
30+
// See this repo's readme.md for info on how to get these images. Or, set the path to any image on your machine.
31+
string imageFilePath = @"Images\faces.jpg";
3132
string remoteImageUrl = "https://github.com/Azure-Samples/cognitive-services-sample-data-files/raw/master/ComputerVision/Images/landmark.jpg";
3233

3334
await AnalyzeFromUrlAsync(remoteImageUrl, endpoint, key);

0 commit comments

Comments
 (0)