Skip to content

AnilOptimizely/Patel.AzureAIContentSafety.Optimizely

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Patel.AzureAIContentSafety.Optimizely

Intro

This is an Add-On which integrates Azure AI Content Safety within Optimizely CMS 12. The Add-On provides users, the features and ability to integrate various functions which are part of the Azure AI Content Safety Service within Optimizely CMS to allow content users to moderate content which is being published within the CMS. Some examples of functionality within this Add-On consists of the following.

Installation

dotnet add package Patel.AzureAIContentSafety.Optimizely

Setup

After installing the package, the following steps are required to be done to setup the Add-On correctly.

Create Azure AI Content Safety Resource

  1. Navigate to the Azure Portal by clicking here
  2. Click on create new resource
  3. Search for Azure AI Content Safety
  4. Select the option Azure AI Content Safety
  5. Fill out details in relation to Project Details (Choose Subscription) and Instance Details (Region/Name/Pricing Tier)
  6. Click Create
  7. When resource has been created, Navigate to the Keys and Endpoint section. An example screenshot of this is shown below

ResourceKey.

  1. Make a note of the Key and Endpoint variables - This will be needed in the Configuration section of Setup.

Configuration

For the Add-On to work, you will have to call the .AddAzureAIContentSafety() extension method in the Startup.ConfigureServices method.

Below is a code snippet with all possible configuration options. Using the Key and Endpoint variables which have been retrieved from the Azure AI Resource, populate these details into the 'TextAnalyticsSubscriptionKey' and 'TextAnalyticsEndpoint' variables as shown below

.AddAzureAIContentSafety(x => {
    x.ContentSafetySubscriptionKey = "************";
    x.ContentSafetyEndpoint = "******************";
})

You will also have to add the following line of code after calling the .AddAzureAIContentSafety() extension method

.AddControllersWithViews().AddRazorRuntimeCompilation();

In the extension method in the Startup.Configure method, the following code will need to be added

.UseEndpoints(endpoints => {
  endpoints.MapContent();
  endpoints.MapControllers();
});

Attributes

Please visit here to find out more information about the various attributes that are contained within this Add-On and how they work.

About

This is an Add-On which integrates Azure AI Content Safety within Optimizely CMS 12.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published