Skip to content

Commit fb74447

Browse files
authored
Updated endpoint
1 parent 0d20f1e commit fb74447

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

dotnet/ComputerVision/BatchReadFile/Program.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ namespace Microsoft.Azure.CognitiveServices.Samples.ComputerVision.BatchReadFile
1111

1212
public class Program
1313
{
14-
public const string subscriptionKey = "<your training key here>"; //Insert your Cognitive Services subscription key here
15-
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.
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");
1617

1718
static void Main(string[] args)
1819
{
@@ -28,8 +29,8 @@ public class BatchReadFileSample
2829
public static async Task RunAsync(string endpoint, string key)
2930
{
3031
Console.WriteLine("Extracting text from the images:");
31-
32-
string imageFilePath = @"Images\handwritten_text.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\handwritten_text.jpg";
3334
string remoteImageUrl = "https://github.com/Azure-Samples/cognitive-services-sample-data-files/raw/master/ComputerVision/Images/printed_text.jpg";
3435

3536
await BatchReadFileFromStreamAsync(imageFilePath, endpoint, key);

0 commit comments

Comments
 (0)