Skip to content

Commit b2ed698

Browse files
authored
Updated endpoint
1 parent 0d20f1e commit b2ed698

File tree

1 file changed

+7
-5
lines changed
  • dotnet/ComputerVision/RecognizeDomainSpecificContent

1 file changed

+7
-5
lines changed

dotnet/ComputerVision/RecognizeDomainSpecificContent/Program.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.RecognizeDoma
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+
14+
// Add your Azure Computer Vision subscription key and endpoint to your environment variables
15+
public const string subscriptionKey = Environment.GetEnvironmentVariable("COMPUTER_VISION_SUBSCRIPTION_KEY");
16+
public const string endpoint = Environment.GetEnvironmentVariable("COMPUTER_VISION_ENDPOINT");
17+
1618
static void Main(string[] args)
1719
{
1820
RecognizeDomainSpecificContentSample.RunAsync(endpoint, subscriptionKey).Wait(5000);
@@ -27,8 +29,8 @@ public class RecognizeDomainSpecificContentSample
2729
public static async Task RunAsync(string endpoint, string key)
2830
{
2931
Console.WriteLine("Recognize domain specific content (celebrities/landmarks) in 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.
32+
// 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.
33+
string imageFilePath = @"Images\landmark.jpg";
3234
string remoteImageUrl = "https://github.com/Azure-Samples/cognitive-services-sample-data-files/raw/master/ComputerVision/Images/celebrities.jpg";
3335

3436
await RecognizeDomainSpecificContentFromUrlAsync(remoteImageUrl, endpoint, key, "celebrities");

0 commit comments

Comments
 (0)