Skip to content

Commit abc4261

Browse files
authored
Merge pull request #93293 from PatrickFarley/conmod-subdomains
[cog serv] updates for subdomains change
2 parents 39fea14 + d28cea2 commit abc4261

11 files changed

+57
-111
lines changed

articles/cognitive-services/Content-Moderator/ecommerce-retail-catalog-moderation.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: content-moderator
1111
ms.topic: tutorial
12-
ms.date: 07/03/2019
12+
ms.date: 10/24/2019
1313
ms.author: pafarley
1414

1515
#As a developer at an e-commerce company, I want to use machine learning to both categorize product images and tag objectionable images for further review by my team.
@@ -63,7 +63,9 @@ This tutorial uses three cognitive services; therefore, it requires three corres
6363

6464
[!code-csharp[define API keys and endpoint URIs](~/samples-eCommerceCatalogModeration/Fusion/Program.cs?range=21-29)]
6565

66-
You'll need to update the `___Key` fields with the values of your subscription keys (you'll get the `CustomVisionKey` later on), and you may need to change the `___Uri` fields so they contain the correct region identifiers. Fill in the `YOURTEAMID` part of the `ReviewUri` field with the ID of the review team you created earlier. You'll fill in the final part of the `CustomVisionUri` field later on.
66+
You'll need to update the `___Key` fields with the values of your subscription keys, and you need to change the `___Uri` fields to the correct endpoint URLs (you'll get the Custom Vision key and endpoint later on). You can find these values in the **Quick start** tabs of each Azure resource. Fill in the `YOURTEAMID` part of the `ReviewUri` field with the ID of the review team you created earlier. You'll fill in the final part of the `CustomVisionUri` field later on.
67+
68+
[!INCLUDE [subdomains note](../../../includes/cognitive-services-custom-subdomains-note.md)]
6769

6870
## Primary method calls
6971

articles/cognitive-services/Content-Moderator/facebook-post-moderation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: content-moderator
1111
ms.topic: tutorial
12-
ms.date: 07/03/2019
12+
ms.date: 10/24/2019
1313
ms.author: pafarley
1414
#Customer intent: As the moderator of a Facebook page, I want to use Azure's machine learning technology to automate and streamline the process of post moderation.
1515
---
@@ -69,7 +69,7 @@ Sign in to the [Azure portal](https://portal.azure.com/) and follow these steps:
6969
| -------------------- |-------------|
7070
| cm:TeamId | Your Content Moderator TeamId |
7171
| cm:SubscriptionKey | Your Content Moderator subscription key - See [Credentials](review-tool-user-guide/credentials.md) |
72-
| cm:Region | Your Content Moderator region name, without the spaces. |
72+
| cm:Region | Your Content Moderator region name, without the spaces. You can find this in the **Location** field of the **Overview** tab of your Azure resource.|
7373
| cm:ImageWorkflow | Name of the workflow to run on Images |
7474
| cm:TextWorkflow | Name of the workflow to run on Text |
7575
| cm:CallbackEndpoint | Url for the CMListener Function App that you will create later in this guide |

articles/cognitive-services/Content-Moderator/image-lists-quickstart-dotnet.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: content-moderator
1111
ms.topic: conceptual
12-
ms.date: 07/03/2019
12+
ms.date: 10/24/2019
1313
ms.author: pafarley
1414
#As a C# developer of content-providing software, I want to check images against a custom list of inappropriate images so that I can handle them more efficiently.
1515
---
@@ -71,11 +71,7 @@ using System.Threading;
7171

7272
### Create the Content Moderator client
7373

74-
Add the following code to create a Content Moderator client for your subscription.
75-
76-
> [!IMPORTANT]
77-
> Update the **AzureRegion** and **CMSubscriptionKey** fields with
78-
> the values of your region identifier and subscription key.
74+
Add the following code to create a Content Moderator client for your subscription. Update the `AzureEndpoint` and `CMSubscriptionKey` fields with the values of your endpoint URL and subscription key. You can find these in the **Quick start** tab of your resource in the Azure portal.
7975

8076
```csharp
8177
/// <summary>
@@ -87,16 +83,9 @@ Add the following code to create a Content Moderator client for your subscriptio
8783
public static class Clients
8884
{
8985
/// <summary>
90-
/// The region/location for your Content Moderator account,
91-
/// for example, westus.
92-
/// </summary>
93-
private static readonly string AzureRegion = "YOUR API REGION";
94-
95-
/// <summary>
96-
/// The base URL fragment for Content Moderator calls.
86+
/// The base URL for Content Moderator calls.
9787
/// </summary>
98-
private static readonly string AzureBaseURL =
99-
$"https://{AzureRegion}.api.cognitive.microsoft.com";
88+
private static readonly string AzureEndpoint = "YOUR ENDPOINT URL";
10089

10190
/// <summary>
10291
/// Your Content Moderator subscription key.
@@ -115,7 +104,7 @@ public static class Clients
115104
// Create and initialize an instance of the Content Moderator API wrapper.
116105
ContentModeratorClient client = new ContentModeratorClient(new ApiKeyServiceClientCredentials(CMSubscriptionKey));
117106

118-
client.Endpoint = AzureBaseURL;
107+
client.Endpoint = AzureEndpoint;
119108
return client;
120109
}
121110
}

articles/cognitive-services/Content-Moderator/image-moderation-quickstart-dotnet.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: content-moderator
1111
ms.topic: quickstart
12-
ms.date: 08/08/2019
12+
ms.date: 10/24/2019
1313
ms.author: pafarley
1414

1515
#As a C# developer of content management software, I want to analyze images for offensive or inappropriate material so that I can categorize and handle it accordingly.
@@ -23,7 +23,7 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
2323

2424
## Prerequisites
2525

26-
- A Content Moderator subscription key. Follow the instructions in [Create a Cognitive Services account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) to subscribe to Content Moderator and get your key.
26+
- A Content Moderator subscription key. Follow the instructions in [Create a Cognitive Services account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) to subscribe to Content Moderator. Then, [create environment variables](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account#configure-an-environment-variable-for-authentication) for the key and endpoint URL, named `CONTENT_MODERATOR_SUBSCRIPTION_KEY` and `CONTENT_MODERATOR_ENDPOINT`, respectively.
2727
- Any edition of [Visual Studio 2015 or 2017](https://www.visualstudio.com/downloads/)
2828

2929

@@ -47,20 +47,20 @@ Next, you'll copy and paste the code from this guide into your project to implem
4747

4848
Add the following `using` statements to the top of your *Program.cs* file.
4949

50-
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?range=1-7)]
50+
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?name=snippet_using)]
5151

5252
### Create the Content Moderator client
5353

54-
Add the following code to your *Program.cs* file to create a Content Moderator client provider for your subscription. Add the code alongside the **Program** class, in the same namespace. You'll need to update the **AzureRegion** and **CMSubscriptionKey** fields with the values of your region identifier and subscription key.
54+
Add the following code to your *Program.cs* file to create a Content Moderator client provider for your subscription. Add the class alongside the **Program** class, in the same namespace. You'll need to update the **AzureBaseURL** and **CMSubscriptionKey** fields with the values of your endpoint URL and subscription key. You can find these in the **Quick start** tab of your resource in the Azure portal.
5555

56-
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?range=83-106)]
56+
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?name=snippet_client)]
5757

5858

5959
### Set up input and output targets
6060

6161
Add the following static fields to the **Program** class in _Program.cs_. These fields specify the files for input image content and output JSON content.
6262

63-
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?range=48-52)]
63+
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?name=snippet_fields)]
6464

6565
You will need to create the *ImageFiles.txt* input file and update its path accordingly (relative paths are relative to the execution directory). Open _ImageFiles.txt_ and add the URLs of images to moderate. This quickstart uses the following URLs as its sample input.
6666

@@ -73,20 +73,20 @@ https://moderatorsampleimages.blob.core.windows.net/samples/sample5.png
7373

7474
Add the following code to *Program.cs*, alongside the **Program** class in the same namespace. You will use an instance of this class to record the moderation results for each of the reviewed images.
7575

76-
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?range=108-123)]
76+
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?name=snippet_dataclass)]
7777

7878

7979
### Define the image evaluation method
8080

8181
Add the following method to the **Program** class. This method evaluates a single image in three different ways and returns the evaluation results. If you want to learn more about what the individual operations do, follow the link in the [Next steps](#next-steps) section.
8282

83-
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?range=54-80)]
83+
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?name=snippet_evaluate)]
8484

8585
### Load the input images
8686

8787
Add the following code to the **Main** method in the **Program** class. This code sets up the program to retrieve evaluation data for each image URL in the input file. It then writes this data to a single output file.
8888

89-
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?range=16-45)]
89+
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/image-moderation-quickstart-dotnet.cs?name=snippet_main)]
9090

9191
## Run the program
9292

articles/cognitive-services/Content-Moderator/moderation-jobs-quickstart-dotnet.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: content-moderator
1111
ms.topic: conceptual
12-
ms.date: 03/18/2019
12+
ms.date: 10/24/2019
1313
ms.author: pafarley
1414
#The jobs how-to for .NET SDK
1515
---
@@ -77,8 +77,8 @@ using System.Threading;
7777
Add the following code to create a Content Moderator client for your subscription.
7878

7979
> [!IMPORTANT]
80-
> Update the **AzureRegion** and **CMSubscriptionKey** fields with
81-
> the values of your region identifier and subscription key.
80+
> Update the **AzureEndpoint** and **CMSubscriptionKey** fields with
81+
> the values of your endpoint URL and subscription key.
8282
8383
```csharp
8484
/// <summary>
@@ -89,17 +89,10 @@ Add the following code to create a Content Moderator client for your subscriptio
8989
/// your Content Moderator subscription key.</remarks>
9090
public static class Clients
9191
{
92-
/// <summary>
93-
/// The region/location for your Content Moderator account,
94-
/// for example, westus.
95-
/// </summary>
96-
private static readonly string AzureRegion = "YOUR API REGION";
97-
9892
/// <summary>
9993
/// The base URL fragment for Content Moderator calls.
10094
/// </summary>
101-
private static readonly string AzureBaseURL =
102-
$"https://{AzureRegion}.api.cognitive.microsoft.com";
95+
private static readonly string AzureEndpoint = "YOUR ENDPOINT URL";
10396

10497
/// <summary>
10598
/// Your Content Moderator subscription key.
@@ -118,7 +111,7 @@ public static class Clients
118111
// Create and initialize an instance of the Content Moderator API wrapper.
119112
ContentModeratorClient client = new ContentModeratorClient(new ApiKeyServiceClientCredentials(CMSubscriptionKey));
120113

121-
client.Endpoint = AzureBaseURL;
114+
client.Endpoint = AzureEndpoint;
122115
return client;
123116
}
124117
}

articles/cognitive-services/Content-Moderator/moderation-reviews-quickstart-dotnet.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: content-moderator
1111
ms.topic: conceptual
12-
ms.date: 03/19/2019
12+
ms.date: 10/24/2019
1313
ms.author: pafarley
1414
# The reviews how-to for .NET SDK
1515
---
@@ -66,10 +66,7 @@ using System.Threading;
6666

6767
### Create the Content Moderator client
6868

69-
Add the following code to create a Content Moderator client for your subscription.
70-
71-
> [!IMPORTANT]
72-
> Update the **AzureRegion** and **CMSubscriptionKey** fields with the values of your region identifier and subscription key.
69+
Add the following code to create a Content Moderator client for your subscription. Update the `AzureEndpoint` and `CMSubscriptionKey` fields with the values of your endpoint URL and subscription key. You can find these in the **Quick start** tab of your resource in the Azure portal.
7370

7471
```csharp
7572
/// <summary>
@@ -80,17 +77,10 @@ Add the following code to create a Content Moderator client for your subscriptio
8077
/// your Content Moderator subscription key.</remarks>
8178
public static class Clients
8279
{
83-
/// <summary>
84-
/// The region/location for your Content Moderator account,
85-
/// for example, westus.
86-
/// </summary>
87-
private static readonly string AzureRegion = "YOUR API REGION";
88-
8980
/// <summary>
9081
/// The base URL fragment for Content Moderator calls.
9182
/// </summary>
92-
private static readonly string AzureBaseURL =
93-
$"https://{AzureRegion}.api.cognitive.microsoft.com";
83+
private static readonly string AzureEndpoint = "YOUR ENDPOINT URL";
9484

9585
/// <summary>
9686
/// Your Content Moderator subscription key.
@@ -109,7 +99,7 @@ public static class Clients
10999
// Create and initialize an instance of the Content Moderator API wrapper.
110100
ContentModeratorClient client = new ContentModeratorClient(new ApiKeyServiceClientCredentials(CMSubscriptionKey));
111101

112-
client.Endpoint = AzureBaseURL;
102+
client.Endpoint = AzureEndpoint;
113103
return client;
114104
}
115105
}

articles/cognitive-services/Content-Moderator/term-lists-quickstart-dotnet.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: content-moderator
1111
ms.topic: conceptual
12-
ms.date: 07/03/2019
12+
ms.date: 10/24/2019
1313
ms.author: pafarley
1414
#As a C# developer of content-providing software, I want to analyze text content for terms that are particular to my product, so that I can categorize and handle it accordingly.
1515
---
@@ -67,11 +67,7 @@ using System.Threading;
6767

6868
### Create the Content Moderator client
6969

70-
Add the following code to create a Content Moderator client for your subscription.
71-
72-
> [!IMPORTANT]
73-
> Update the **AzureRegion** and **CMSubscriptionKey** fields with
74-
> the values of your region identifier and subscription key.
70+
Add the following code to create a Content Moderator client for your subscription. Update the `AzureEndpoint` and `CMSubscriptionKey` fields with the values of your endpoint URL and subscription key. You can find these in the **Quick start** tab of your resource in the Azure portal.
7571

7672
```csharp
7773
/// <summary>
@@ -82,17 +78,10 @@ Add the following code to create a Content Moderator client for your subscriptio
8278
/// your Content Moderator subscription key.</remarks>
8379
public static class Clients
8480
{
85-
/// <summary>
86-
/// The region/location for your Content Moderator account,
87-
/// for example, westus.
88-
/// </summary>
89-
private static readonly string AzureRegion = "YOUR API REGION";
90-
9181
/// <summary>
9282
/// The base URL fragment for Content Moderator calls.
9383
/// </summary>
94-
private static readonly string AzureBaseURL =
95-
$"https://{AzureRegion}.api.cognitive.microsoft.com";
84+
private static readonly string AzureEndpoint = "YOUR ENDPOINT URL";
9685

9786
/// <summary>
9887
/// Your Content Moderator subscription key.
@@ -111,7 +100,7 @@ public static class Clients
111100
// Create and initialize an instance of the Content Moderator API wrapper.
112101
ContentModeratorClient client = new ContentModeratorClient(new ApiKeyServiceClientCredentials(CMSubscriptionKey));
113102

114-
client.Endpoint = AzureBaseURL;
103+
client.Endpoint = AzureEndpoint;
115104
return client;
116105
}
117106
}

articles/cognitive-services/Content-Moderator/text-moderation-quickstart-dotnet.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: content-moderator
1111
ms.topic: quickstart
12-
ms.date: 07/03/2019
12+
ms.date: 10/24/2019
1313
ms.author: pafarley
1414

1515
#As a C# developer of content management software, I want to analyze text content for offensive or inappropriate material so that I can categorize and handle it accordingly.
@@ -22,7 +22,7 @@ This article provides information and code samples to help you get started using
2222
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
2323

2424
## Prerequisites
25-
- A Content Moderator subscription key. Follow the instructions in [Create a Cognitive Services account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) to subscribe to Content Moderator and get your key.
25+
- A Content Moderator subscription key. Follow the instructions in [Create a Cognitive Services account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) to subscribe to Content Moderator. Then, [create environment variables](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account#configure-an-environment-variable-for-authentication) for the key and endpoint URL, named `CONTENT_MODERATOR_SUBSCRIPTION_KEY` and `CONTENT_MODERATOR_ENDPOINT`, respectively.
2626
- Any edition of [Visual Studio 2015 or 2017](https://www.visualstudio.com/downloads/)
2727

2828
> [!NOTE]
@@ -46,19 +46,19 @@ Next, you'll copy and paste the code from this guide into your project to implem
4646

4747
Add the following `using` statements to the top of your *Program.cs* file.
4848

49-
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/text-moderation-quickstart-dotnet.cs?range=1-8)]
49+
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/text-moderation-quickstart-dotnet.cs?name=snippet_using)]
5050

5151
### Create the Content Moderator client
5252

53-
Add the following code to your *Program.cs* file to create a Content Moderator client provider for your subscription. Add the code alongside the **Program** class, in the same namespace. You'll need to update the **AzureRegion** and **CMSubscriptionKey** fields with the values of your region identifier and subscription key.
53+
Add the following code to your *Program.cs* file to create a Content Moderator client provider for your subscription. Add the class alongside the **Program** class, in the same namespace. You'll need to update the **AzureBaseURL** and **CMSubscriptionKey** fields with the values of your endpoint URL and subscription key. You can find these in the **Quick start** tab of your resource in the Azure portal.
5454

55-
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/text-moderation-quickstart-dotnet.cs?range=54-77)]
55+
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/text-moderation-quickstart-dotnet.cs?name=snippet_client)]
5656

5757
### Set up input and output targets
5858

5959
Add the following static fields to the **Program** class in _Program.cs_. These fields specify the files for input text content and output JSON content.
6060

61-
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/text-moderation-quickstart-dotnet.cs?range=15-19)]
61+
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/text-moderation-quickstart-dotnet.cs?name=snippet_fields)]
6262

6363
You will need to create the *TextFile.txt* input file and update its path (paths are relative to the execution directory). Open _TextFile.txt_ and add the text to moderate. This quickstart uses the following sample text:
6464

@@ -78,7 +78,7 @@ Add the following code to the **Main** method. The **ScreenText** method is the
7878

7979
If you want to learn more about what these operations do, follow the link in the [Next steps](#next-steps) section.
8080

81-
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/text-moderation-quickstart-dotnet.cs?range=23-48)]
81+
[!code-csharp[](~/cognitive-services-content-moderator-samples/documentation-samples/csharp/text-moderation-quickstart-dotnet.cs?name=snippet_main)]
8282

8383
## Run the program
8484

0 commit comments

Comments
 (0)