Skip to content

Commit 0f4faae

Browse files
wiazuryangyuan
authored andcommitted
Updated key/endpoint (#167)
Endpoints are not region-based anymore, but rather custom domain -based. Although regional endpoints will still work. Also, the authentication information is moving to a standard of getting it from environment variables.
1 parent 651ba30 commit 0f4faae

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

ContentModerator/VideoTranscriptReviews/Program.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,13 @@
1111
namespace VideoTranscriptReviews
1212
{
1313
class Program
14-
{
15-
// NOTE: Replace this example location with the location for your Content Moderator account.
16-
/// <summary>
17-
/// The region/location for your Content Moderator account,
18-
/// for example, westus.
19-
/// </summary>
20-
private static readonly string AzureRegion = "YOUR API REGION";
21-
22-
// NOTE: Replace this example key with a valid subscription key.
14+
{
2315
/// <summary>
2416
/// Your Content Moderator subscription key.
17+
/// Add your Azure Face subscription key to your environment variables.
2518
/// </summary>
26-
private static readonly string CMSubscriptionKey = "YOUR API KEY";
19+
private static readonly string CMSubscriptionKey =
20+
Environment.GetEnvironmentVariable("FACE_SUBSCRIPTION_KEY");
2721

2822
// NOTE: Replace this example team name with your Content Moderator team Id.
2923
/// <summary>
@@ -37,9 +31,10 @@ class Program
3731

3832
/// <summary>
3933
/// The base URL fragment for Content Moderator calls.
34+
/// Add your Azure Content Moderator endpoint to your environment variables.
4035
/// </summary>
4136
private static readonly string AzureBaseURL =
42-
$"https://{AzureRegion}.api.cognitive.microsoft.com";
37+
Environment.GetEnvironmentVariable("CONTENT_MODERATOR_ENDPOINT");
4338

4439
/// <summary>
4540
/// The minimum amount of time, in milliseconds, to wait between calls

0 commit comments

Comments
 (0)