1. Packages
  2. Azure Native v2
  3. API Docs
  4. cognitiveservices
  5. RaiPolicy
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.cognitiveservices.RaiPolicy

Explore with Pulumi AI

These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

Cognitive Services RaiPolicy. Azure REST API version: 2023-10-01-preview.

Other available API versions: 2024-04-01-preview, 2024-06-01-preview, 2024-10-01.

Example Usage

PutRaiPolicy

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var raiPolicy = new AzureNative.CognitiveServices.RaiPolicy("raiPolicy", new()
    {
        AccountName = "accountName",
        Properties = new AzureNative.CognitiveServices.Inputs.RaiPolicyPropertiesArgs
        {
            BasePolicyName = "Microsoft.Default",
            ContentFilters = new[]
            {
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    AllowedContentLevel = AzureNative.CognitiveServices.AllowedContentLevel.High,
                    Blocking = false,
                    Enabled = false,
                    Name = "hate",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
                },
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    AllowedContentLevel = AzureNative.CognitiveServices.AllowedContentLevel.Medium,
                    Blocking = true,
                    Enabled = true,
                    Name = "hate",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
                },
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    AllowedContentLevel = AzureNative.CognitiveServices.AllowedContentLevel.High,
                    Blocking = true,
                    Enabled = true,
                    Name = "sexual",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
                },
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    AllowedContentLevel = AzureNative.CognitiveServices.AllowedContentLevel.Medium,
                    Blocking = true,
                    Enabled = true,
                    Name = "sexual",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
                },
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    AllowedContentLevel = AzureNative.CognitiveServices.AllowedContentLevel.High,
                    Blocking = true,
                    Enabled = true,
                    Name = "selfharm",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
                },
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    AllowedContentLevel = AzureNative.CognitiveServices.AllowedContentLevel.Medium,
                    Blocking = true,
                    Enabled = true,
                    Name = "selfharm",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
                },
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    AllowedContentLevel = AzureNative.CognitiveServices.AllowedContentLevel.Medium,
                    Blocking = true,
                    Enabled = true,
                    Name = "violence",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
                },
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    AllowedContentLevel = AzureNative.CognitiveServices.AllowedContentLevel.Medium,
                    Blocking = true,
                    Enabled = true,
                    Name = "violence",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
                },
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    Blocking = true,
                    Enabled = true,
                    Name = "jailbreak",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
                },
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    Blocking = true,
                    Enabled = true,
                    Name = "protected_material_text",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
                },
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    Blocking = true,
                    Enabled = true,
                    Name = "protected_material_code",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Completion,
                },
                new AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterArgs
                {
                    Blocking = true,
                    Enabled = true,
                    Name = "profanity",
                    Source = AzureNative.CognitiveServices.RaiPolicyContentSource.Prompt,
                },
            },
            Mode = AzureNative.CognitiveServices.RaiPolicyMode.Deferred,
        },
        RaiPolicyName = "raiPolicyName",
        ResourceGroupName = "resourceGroupName",
    });

});
Copy
package main

import (
	cognitiveservices "github.com/pulumi/pulumi-azure-native-sdk/cognitiveservices/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cognitiveservices.NewRaiPolicy(ctx, "raiPolicy", &cognitiveservices.RaiPolicyArgs{
			AccountName: pulumi.String("accountName"),
			Properties: &cognitiveservices.RaiPolicyPropertiesArgs{
				BasePolicyName: pulumi.String("Microsoft.Default"),
				ContentFilters: cognitiveservices.RaiPolicyContentFilterArray{
					&cognitiveservices.RaiPolicyContentFilterArgs{
						AllowedContentLevel: pulumi.String(cognitiveservices.AllowedContentLevelHigh),
						Blocking:            pulumi.Bool(false),
						Enabled:             pulumi.Bool(false),
						Name:                pulumi.String("hate"),
						Source:              pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
					},
					&cognitiveservices.RaiPolicyContentFilterArgs{
						AllowedContentLevel: pulumi.String(cognitiveservices.AllowedContentLevelMedium),
						Blocking:            pulumi.Bool(true),
						Enabled:             pulumi.Bool(true),
						Name:                pulumi.String("hate"),
						Source:              pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
					},
					&cognitiveservices.RaiPolicyContentFilterArgs{
						AllowedContentLevel: pulumi.String(cognitiveservices.AllowedContentLevelHigh),
						Blocking:            pulumi.Bool(true),
						Enabled:             pulumi.Bool(true),
						Name:                pulumi.String("sexual"),
						Source:              pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
					},
					&cognitiveservices.RaiPolicyContentFilterArgs{
						AllowedContentLevel: pulumi.String(cognitiveservices.AllowedContentLevelMedium),
						Blocking:            pulumi.Bool(true),
						Enabled:             pulumi.Bool(true),
						Name:                pulumi.String("sexual"),
						Source:              pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
					},
					&cognitiveservices.RaiPolicyContentFilterArgs{
						AllowedContentLevel: pulumi.String(cognitiveservices.AllowedContentLevelHigh),
						Blocking:            pulumi.Bool(true),
						Enabled:             pulumi.Bool(true),
						Name:                pulumi.String("selfharm"),
						Source:              pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
					},
					&cognitiveservices.RaiPolicyContentFilterArgs{
						AllowedContentLevel: pulumi.String(cognitiveservices.AllowedContentLevelMedium),
						Blocking:            pulumi.Bool(true),
						Enabled:             pulumi.Bool(true),
						Name:                pulumi.String("selfharm"),
						Source:              pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
					},
					&cognitiveservices.RaiPolicyContentFilterArgs{
						AllowedContentLevel: pulumi.String(cognitiveservices.AllowedContentLevelMedium),
						Blocking:            pulumi.Bool(true),
						Enabled:             pulumi.Bool(true),
						Name:                pulumi.String("violence"),
						Source:              pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
					},
					&cognitiveservices.RaiPolicyContentFilterArgs{
						AllowedContentLevel: pulumi.String(cognitiveservices.AllowedContentLevelMedium),
						Blocking:            pulumi.Bool(true),
						Enabled:             pulumi.Bool(true),
						Name:                pulumi.String("violence"),
						Source:              pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
					},
					&cognitiveservices.RaiPolicyContentFilterArgs{
						Blocking: pulumi.Bool(true),
						Enabled:  pulumi.Bool(true),
						Name:     pulumi.String("jailbreak"),
						Source:   pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
					},
					&cognitiveservices.RaiPolicyContentFilterArgs{
						Blocking: pulumi.Bool(true),
						Enabled:  pulumi.Bool(true),
						Name:     pulumi.String("protected_material_text"),
						Source:   pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
					},
					&cognitiveservices.RaiPolicyContentFilterArgs{
						Blocking: pulumi.Bool(true),
						Enabled:  pulumi.Bool(true),
						Name:     pulumi.String("protected_material_code"),
						Source:   pulumi.String(cognitiveservices.RaiPolicyContentSourceCompletion),
					},
					&cognitiveservices.RaiPolicyContentFilterArgs{
						Blocking: pulumi.Bool(true),
						Enabled:  pulumi.Bool(true),
						Name:     pulumi.String("profanity"),
						Source:   pulumi.String(cognitiveservices.RaiPolicyContentSourcePrompt),
					},
				},
				Mode: pulumi.String(cognitiveservices.RaiPolicyModeDeferred),
			},
			RaiPolicyName:     pulumi.String("raiPolicyName"),
			ResourceGroupName: pulumi.String("resourceGroupName"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.cognitiveservices.RaiPolicy;
import com.pulumi.azurenative.cognitiveservices.RaiPolicyArgs;
import com.pulumi.azurenative.cognitiveservices.inputs.RaiPolicyPropertiesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var raiPolicy = new RaiPolicy("raiPolicy", RaiPolicyArgs.builder()
            .accountName("accountName")
            .properties(RaiPolicyPropertiesArgs.builder()
                .basePolicyName("Microsoft.Default")
                .contentFilters(                
                    RaiPolicyContentFilterArgs.builder()
                        .allowedContentLevel("High")
                        .blocking(false)
                        .enabled(false)
                        .name("hate")
                        .source("Prompt")
                        .build(),
                    RaiPolicyContentFilterArgs.builder()
                        .allowedContentLevel("Medium")
                        .blocking(true)
                        .enabled(true)
                        .name("hate")
                        .source("Completion")
                        .build(),
                    RaiPolicyContentFilterArgs.builder()
                        .allowedContentLevel("High")
                        .blocking(true)
                        .enabled(true)
                        .name("sexual")
                        .source("Prompt")
                        .build(),
                    RaiPolicyContentFilterArgs.builder()
                        .allowedContentLevel("Medium")
                        .blocking(true)
                        .enabled(true)
                        .name("sexual")
                        .source("Completion")
                        .build(),
                    RaiPolicyContentFilterArgs.builder()
                        .allowedContentLevel("High")
                        .blocking(true)
                        .enabled(true)
                        .name("selfharm")
                        .source("Prompt")
                        .build(),
                    RaiPolicyContentFilterArgs.builder()
                        .allowedContentLevel("Medium")
                        .blocking(true)
                        .enabled(true)
                        .name("selfharm")
                        .source("Completion")
                        .build(),
                    RaiPolicyContentFilterArgs.builder()
                        .allowedContentLevel("Medium")
                        .blocking(true)
                        .enabled(true)
                        .name("violence")
                        .source("Prompt")
                        .build(),
                    RaiPolicyContentFilterArgs.builder()
                        .allowedContentLevel("Medium")
                        .blocking(true)
                        .enabled(true)
                        .name("violence")
                        .source("Completion")
                        .build(),
                    RaiPolicyContentFilterArgs.builder()
                        .blocking(true)
                        .enabled(true)
                        .name("jailbreak")
                        .source("Prompt")
                        .build(),
                    RaiPolicyContentFilterArgs.builder()
                        .blocking(true)
                        .enabled(true)
                        .name("protected_material_text")
                        .source("Completion")
                        .build(),
                    RaiPolicyContentFilterArgs.builder()
                        .blocking(true)
                        .enabled(true)
                        .name("protected_material_code")
                        .source("Completion")
                        .build(),
                    RaiPolicyContentFilterArgs.builder()
                        .blocking(true)
                        .enabled(true)
                        .name("profanity")
                        .source("Prompt")
                        .build())
                .mode("Deferred")
                .build())
            .raiPolicyName("raiPolicyName")
            .resourceGroupName("resourceGroupName")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const raiPolicy = new azure_native.cognitiveservices.RaiPolicy("raiPolicy", {
    accountName: "accountName",
    properties: {
        basePolicyName: "Microsoft.Default",
        contentFilters: [
            {
                allowedContentLevel: azure_native.cognitiveservices.AllowedContentLevel.High,
                blocking: false,
                enabled: false,
                name: "hate",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
            },
            {
                allowedContentLevel: azure_native.cognitiveservices.AllowedContentLevel.Medium,
                blocking: true,
                enabled: true,
                name: "hate",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
            },
            {
                allowedContentLevel: azure_native.cognitiveservices.AllowedContentLevel.High,
                blocking: true,
                enabled: true,
                name: "sexual",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
            },
            {
                allowedContentLevel: azure_native.cognitiveservices.AllowedContentLevel.Medium,
                blocking: true,
                enabled: true,
                name: "sexual",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
            },
            {
                allowedContentLevel: azure_native.cognitiveservices.AllowedContentLevel.High,
                blocking: true,
                enabled: true,
                name: "selfharm",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
            },
            {
                allowedContentLevel: azure_native.cognitiveservices.AllowedContentLevel.Medium,
                blocking: true,
                enabled: true,
                name: "selfharm",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
            },
            {
                allowedContentLevel: azure_native.cognitiveservices.AllowedContentLevel.Medium,
                blocking: true,
                enabled: true,
                name: "violence",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
            },
            {
                allowedContentLevel: azure_native.cognitiveservices.AllowedContentLevel.Medium,
                blocking: true,
                enabled: true,
                name: "violence",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
            },
            {
                blocking: true,
                enabled: true,
                name: "jailbreak",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
            },
            {
                blocking: true,
                enabled: true,
                name: "protected_material_text",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
            },
            {
                blocking: true,
                enabled: true,
                name: "protected_material_code",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Completion,
            },
            {
                blocking: true,
                enabled: true,
                name: "profanity",
                source: azure_native.cognitiveservices.RaiPolicyContentSource.Prompt,
            },
        ],
        mode: azure_native.cognitiveservices.RaiPolicyMode.Deferred,
    },
    raiPolicyName: "raiPolicyName",
    resourceGroupName: "resourceGroupName",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

rai_policy = azure_native.cognitiveservices.RaiPolicy("raiPolicy",
    account_name="accountName",
    properties={
        "base_policy_name": "Microsoft.Default",
        "content_filters": [
            {
                "allowed_content_level": azure_native.cognitiveservices.AllowedContentLevel.HIGH,
                "blocking": False,
                "enabled": False,
                "name": "hate",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
            },
            {
                "allowed_content_level": azure_native.cognitiveservices.AllowedContentLevel.MEDIUM,
                "blocking": True,
                "enabled": True,
                "name": "hate",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
            },
            {
                "allowed_content_level": azure_native.cognitiveservices.AllowedContentLevel.HIGH,
                "blocking": True,
                "enabled": True,
                "name": "sexual",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
            },
            {
                "allowed_content_level": azure_native.cognitiveservices.AllowedContentLevel.MEDIUM,
                "blocking": True,
                "enabled": True,
                "name": "sexual",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
            },
            {
                "allowed_content_level": azure_native.cognitiveservices.AllowedContentLevel.HIGH,
                "blocking": True,
                "enabled": True,
                "name": "selfharm",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
            },
            {
                "allowed_content_level": azure_native.cognitiveservices.AllowedContentLevel.MEDIUM,
                "blocking": True,
                "enabled": True,
                "name": "selfharm",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
            },
            {
                "allowed_content_level": azure_native.cognitiveservices.AllowedContentLevel.MEDIUM,
                "blocking": True,
                "enabled": True,
                "name": "violence",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
            },
            {
                "allowed_content_level": azure_native.cognitiveservices.AllowedContentLevel.MEDIUM,
                "blocking": True,
                "enabled": True,
                "name": "violence",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
            },
            {
                "blocking": True,
                "enabled": True,
                "name": "jailbreak",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
            },
            {
                "blocking": True,
                "enabled": True,
                "name": "protected_material_text",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
            },
            {
                "blocking": True,
                "enabled": True,
                "name": "protected_material_code",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.COMPLETION,
            },
            {
                "blocking": True,
                "enabled": True,
                "name": "profanity",
                "source": azure_native.cognitiveservices.RaiPolicyContentSource.PROMPT,
            },
        ],
        "mode": azure_native.cognitiveservices.RaiPolicyMode.DEFERRED,
    },
    rai_policy_name="raiPolicyName",
    resource_group_name="resourceGroupName")
Copy
resources:
  raiPolicy:
    type: azure-native:cognitiveservices:RaiPolicy
    properties:
      accountName: accountName
      properties:
        basePolicyName: Microsoft.Default
        contentFilters:
          - allowedContentLevel: High
            blocking: false
            enabled: false
            name: hate
            source: Prompt
          - allowedContentLevel: Medium
            blocking: true
            enabled: true
            name: hate
            source: Completion
          - allowedContentLevel: High
            blocking: true
            enabled: true
            name: sexual
            source: Prompt
          - allowedContentLevel: Medium
            blocking: true
            enabled: true
            name: sexual
            source: Completion
          - allowedContentLevel: High
            blocking: true
            enabled: true
            name: selfharm
            source: Prompt
          - allowedContentLevel: Medium
            blocking: true
            enabled: true
            name: selfharm
            source: Completion
          - allowedContentLevel: Medium
            blocking: true
            enabled: true
            name: violence
            source: Prompt
          - allowedContentLevel: Medium
            blocking: true
            enabled: true
            name: violence
            source: Completion
          - blocking: true
            enabled: true
            name: jailbreak
            source: Prompt
          - blocking: true
            enabled: true
            name: protected_material_text
            source: Completion
          - blocking: true
            enabled: true
            name: protected_material_code
            source: Completion
          - blocking: true
            enabled: true
            name: profanity
            source: Prompt
        mode: Deferred
      raiPolicyName: raiPolicyName
      resourceGroupName: resourceGroupName
Copy

Create RaiPolicy Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RaiPolicy(name: string, args: RaiPolicyArgs, opts?: CustomResourceOptions);
@overload
def RaiPolicy(resource_name: str,
              args: RaiPolicyArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def RaiPolicy(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              account_name: Optional[str] = None,
              resource_group_name: Optional[str] = None,
              properties: Optional[RaiPolicyPropertiesArgs] = None,
              rai_policy_name: Optional[str] = None,
              tags: Optional[Mapping[str, str]] = None)
func NewRaiPolicy(ctx *Context, name string, args RaiPolicyArgs, opts ...ResourceOption) (*RaiPolicy, error)
public RaiPolicy(string name, RaiPolicyArgs args, CustomResourceOptions? opts = null)
public RaiPolicy(String name, RaiPolicyArgs args)
public RaiPolicy(String name, RaiPolicyArgs args, CustomResourceOptions options)
type: azure-native:cognitiveservices:RaiPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RaiPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RaiPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RaiPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RaiPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RaiPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var raiPolicyResource = new AzureNative.Cognitiveservices.RaiPolicy("raiPolicyResource", new()
{
    AccountName = "string",
    ResourceGroupName = "string",
    Properties = 
    {
        { "basePolicyName", "string" },
        { "completionBlocklists", new[]
        {
            
            {
                { "blocking", false },
                { "blocklistName", "string" },
            },
        } },
        { "contentFilters", new[]
        {
            
            {
                { "allowedContentLevel", "string" },
                { "blocking", false },
                { "enabled", false },
                { "name", "string" },
                { "source", "string" },
            },
        } },
        { "mode", "string" },
        { "promptBlocklists", new[]
        {
            
            {
                { "blocking", false },
                { "blocklistName", "string" },
            },
        } },
    },
    RaiPolicyName = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := cognitiveservices.NewRaiPolicy(ctx, "raiPolicyResource", &cognitiveservices.RaiPolicyArgs{
	AccountName:       "string",
	ResourceGroupName: "string",
	Properties: map[string]interface{}{
		"basePolicyName": "string",
		"completionBlocklists": []map[string]interface{}{
			map[string]interface{}{
				"blocking":      false,
				"blocklistName": "string",
			},
		},
		"contentFilters": []map[string]interface{}{
			map[string]interface{}{
				"allowedContentLevel": "string",
				"blocking":            false,
				"enabled":             false,
				"name":                "string",
				"source":              "string",
			},
		},
		"mode": "string",
		"promptBlocklists": []map[string]interface{}{
			map[string]interface{}{
				"blocking":      false,
				"blocklistName": "string",
			},
		},
	},
	RaiPolicyName: "string",
	Tags: map[string]interface{}{
		"string": "string",
	},
})
Copy
var raiPolicyResource = new com.pulumi.azurenative.cognitiveservices.RaiPolicy("raiPolicyResource", com.pulumi.azurenative.cognitiveservices.RaiPolicyArgs.builder()
    .accountName("string")
    .resourceGroupName("string")
    .properties(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .raiPolicyName("string")
    .tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .build());
Copy
rai_policy_resource = azure_native.cognitiveservices.RaiPolicy("raiPolicyResource",
    account_name=string,
    resource_group_name=string,
    properties={
        basePolicyName: string,
        completionBlocklists: [{
            blocking: False,
            blocklistName: string,
        }],
        contentFilters: [{
            allowedContentLevel: string,
            blocking: False,
            enabled: False,
            name: string,
            source: string,
        }],
        mode: string,
        promptBlocklists: [{
            blocking: False,
            blocklistName: string,
        }],
    },
    rai_policy_name=string,
    tags={
        string: string,
    })
Copy
const raiPolicyResource = new azure_native.cognitiveservices.RaiPolicy("raiPolicyResource", {
    accountName: "string",
    resourceGroupName: "string",
    properties: {
        basePolicyName: "string",
        completionBlocklists: [{
            blocking: false,
            blocklistName: "string",
        }],
        contentFilters: [{
            allowedContentLevel: "string",
            blocking: false,
            enabled: false,
            name: "string",
            source: "string",
        }],
        mode: "string",
        promptBlocklists: [{
            blocking: false,
            blocklistName: "string",
        }],
    },
    raiPolicyName: "string",
    tags: {
        string: "string",
    },
});
Copy
type: azure-native:cognitiveservices:RaiPolicy
properties:
    accountName: string
    properties:
        basePolicyName: string
        completionBlocklists:
            - blocking: false
              blocklistName: string
        contentFilters:
            - allowedContentLevel: string
              blocking: false
              enabled: false
              name: string
              source: string
        mode: string
        promptBlocklists:
            - blocking: false
              blocklistName: string
    raiPolicyName: string
    resourceGroupName: string
    tags:
        string: string
Copy

RaiPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The RaiPolicy resource accepts the following input properties:

AccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of Cognitive Services account.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
Properties Pulumi.AzureNative.CognitiveServices.Inputs.RaiPolicyProperties
Properties of Cognitive Services RaiPolicy.
RaiPolicyName Changes to this property will trigger replacement. string
The name of the RaiPolicy associated with the Cognitive Services Account
Tags Dictionary<string, string>
Resource tags.
AccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of Cognitive Services account.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
Properties RaiPolicyPropertiesArgs
Properties of Cognitive Services RaiPolicy.
RaiPolicyName Changes to this property will trigger replacement. string
The name of the RaiPolicy associated with the Cognitive Services Account
Tags map[string]string
Resource tags.
accountName
This property is required.
Changes to this property will trigger replacement.
String
The name of Cognitive Services account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
properties RaiPolicyProperties
Properties of Cognitive Services RaiPolicy.
raiPolicyName Changes to this property will trigger replacement. String
The name of the RaiPolicy associated with the Cognitive Services Account
tags Map<String,String>
Resource tags.
accountName
This property is required.
Changes to this property will trigger replacement.
string
The name of Cognitive Services account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
properties RaiPolicyProperties
Properties of Cognitive Services RaiPolicy.
raiPolicyName Changes to this property will trigger replacement. string
The name of the RaiPolicy associated with the Cognitive Services Account
tags {[key: string]: string}
Resource tags.
account_name
This property is required.
Changes to this property will trigger replacement.
str
The name of Cognitive Services account.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group. The name is case insensitive.
properties RaiPolicyPropertiesArgs
Properties of Cognitive Services RaiPolicy.
rai_policy_name Changes to this property will trigger replacement. str
The name of the RaiPolicy associated with the Cognitive Services Account
tags Mapping[str, str]
Resource tags.
accountName
This property is required.
Changes to this property will trigger replacement.
String
The name of Cognitive Services account.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
properties Property Map
Properties of Cognitive Services RaiPolicy.
raiPolicyName Changes to this property will trigger replacement. String
The name of the RaiPolicy associated with the Cognitive Services Account
tags Map<String>
Resource tags.

Outputs

All input properties are implicitly available as output properties. Additionally, the RaiPolicy resource produces the following output properties:

Etag string
Resource Etag.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
SystemData Pulumi.AzureNative.CognitiveServices.Outputs.SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Etag string
Resource Etag.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
SystemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag String
Resource Etag.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
systemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag string
Resource Etag.
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the resource
systemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag str
Resource Etag.
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the resource
system_data SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type str
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
etag String
Resource Etag.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
systemData Property Map
Metadata pertaining to creation and last modification of the resource.
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Supporting Types

AllowedContentLevel
, AllowedContentLevelArgs

Low
Low
Medium
Medium
High
High
AllowedContentLevelLow
Low
AllowedContentLevelMedium
Medium
AllowedContentLevelHigh
High
Low
Low
Medium
Medium
High
High
Low
Low
Medium
Medium
High
High
LOW
Low
MEDIUM
Medium
HIGH
High
"Low"
Low
"Medium"
Medium
"High"
High

RaiBlocklistConfig
, RaiBlocklistConfigArgs

Blocking bool
If blocking would occur.
BlocklistName string
Name of ContentFilter.
Blocking bool
If blocking would occur.
BlocklistName string
Name of ContentFilter.
blocking Boolean
If blocking would occur.
blocklistName String
Name of ContentFilter.
blocking boolean
If blocking would occur.
blocklistName string
Name of ContentFilter.
blocking bool
If blocking would occur.
blocklist_name str
Name of ContentFilter.
blocking Boolean
If blocking would occur.
blocklistName String
Name of ContentFilter.

RaiBlocklistConfigResponse
, RaiBlocklistConfigResponseArgs

Blocking bool
If blocking would occur.
BlocklistName string
Name of ContentFilter.
Blocking bool
If blocking would occur.
BlocklistName string
Name of ContentFilter.
blocking Boolean
If blocking would occur.
blocklistName String
Name of ContentFilter.
blocking boolean
If blocking would occur.
blocklistName string
Name of ContentFilter.
blocking bool
If blocking would occur.
blocklist_name str
Name of ContentFilter.
blocking Boolean
If blocking would occur.
blocklistName String
Name of ContentFilter.

RaiPolicyContentFilter
, RaiPolicyContentFilterArgs

AllowedContentLevel string | Pulumi.AzureNative.CognitiveServices.AllowedContentLevel
Level at which content is filtered.
Blocking bool
If blocking would occur.
Enabled bool
If the ContentFilter is enabled.
Name string
Name of ContentFilter.
Source string | Pulumi.AzureNative.CognitiveServices.RaiPolicyContentSource
Content source to apply the Content Filters.
AllowedContentLevel string | AllowedContentLevel
Level at which content is filtered.
Blocking bool
If blocking would occur.
Enabled bool
If the ContentFilter is enabled.
Name string
Name of ContentFilter.
Source string | RaiPolicyContentSource
Content source to apply the Content Filters.
allowedContentLevel String | AllowedContentLevel
Level at which content is filtered.
blocking Boolean
If blocking would occur.
enabled Boolean
If the ContentFilter is enabled.
name String
Name of ContentFilter.
source String | RaiPolicyContentSource
Content source to apply the Content Filters.
allowedContentLevel string | AllowedContentLevel
Level at which content is filtered.
blocking boolean
If blocking would occur.
enabled boolean
If the ContentFilter is enabled.
name string
Name of ContentFilter.
source string | RaiPolicyContentSource
Content source to apply the Content Filters.
allowed_content_level str | AllowedContentLevel
Level at which content is filtered.
blocking bool
If blocking would occur.
enabled bool
If the ContentFilter is enabled.
name str
Name of ContentFilter.
source str | RaiPolicyContentSource
Content source to apply the Content Filters.
allowedContentLevel String | "Low" | "Medium" | "High"
Level at which content is filtered.
blocking Boolean
If blocking would occur.
enabled Boolean
If the ContentFilter is enabled.
name String
Name of ContentFilter.
source String | "Prompt" | "Completion"
Content source to apply the Content Filters.

RaiPolicyContentFilterResponse
, RaiPolicyContentFilterResponseArgs

AllowedContentLevel string
Level at which content is filtered.
Blocking bool
If blocking would occur.
Enabled bool
If the ContentFilter is enabled.
Name string
Name of ContentFilter.
Source string
Content source to apply the Content Filters.
AllowedContentLevel string
Level at which content is filtered.
Blocking bool
If blocking would occur.
Enabled bool
If the ContentFilter is enabled.
Name string
Name of ContentFilter.
Source string
Content source to apply the Content Filters.
allowedContentLevel String
Level at which content is filtered.
blocking Boolean
If blocking would occur.
enabled Boolean
If the ContentFilter is enabled.
name String
Name of ContentFilter.
source String
Content source to apply the Content Filters.
allowedContentLevel string
Level at which content is filtered.
blocking boolean
If blocking would occur.
enabled boolean
If the ContentFilter is enabled.
name string
Name of ContentFilter.
source string
Content source to apply the Content Filters.
allowed_content_level str
Level at which content is filtered.
blocking bool
If blocking would occur.
enabled bool
If the ContentFilter is enabled.
name str
Name of ContentFilter.
source str
Content source to apply the Content Filters.
allowedContentLevel String
Level at which content is filtered.
blocking Boolean
If blocking would occur.
enabled Boolean
If the ContentFilter is enabled.
name String
Name of ContentFilter.
source String
Content source to apply the Content Filters.

RaiPolicyContentSource
, RaiPolicyContentSourceArgs

Prompt
Prompt
Completion
Completion
RaiPolicyContentSourcePrompt
Prompt
RaiPolicyContentSourceCompletion
Completion
Prompt
Prompt
Completion
Completion
Prompt
Prompt
Completion
Completion
PROMPT
Prompt
COMPLETION
Completion
"Prompt"
Prompt
"Completion"
Completion

RaiPolicyMode
, RaiPolicyModeArgs

Default
Default
Deferred
Deferred
Blocking
Blocking
RaiPolicyModeDefault
Default
RaiPolicyModeDeferred
Deferred
RaiPolicyModeBlocking
Blocking
Default
Default
Deferred
Deferred
Blocking
Blocking
Default
Default
Deferred
Deferred
Blocking
Blocking
DEFAULT
Default
DEFERRED
Deferred
BLOCKING
Blocking
"Default"
Default
"Deferred"
Deferred
"Blocking"
Blocking

RaiPolicyProperties
, RaiPolicyPropertiesArgs

BasePolicyName string
Name of the base Content Filters.
CompletionBlocklists []RaiBlocklistConfig
The list of blocklists for completion.
ContentFilters []RaiPolicyContentFilter
The list of Content Filters.
Mode string | RaiPolicyMode
Content Filters mode.
PromptBlocklists []RaiBlocklistConfig
The list of blocklists for prompt.
basePolicyName String
Name of the base Content Filters.
completionBlocklists List<RaiBlocklistConfig>
The list of blocklists for completion.
contentFilters List<RaiPolicyContentFilter>
The list of Content Filters.
mode String | RaiPolicyMode
Content Filters mode.
promptBlocklists List<RaiBlocklistConfig>
The list of blocklists for prompt.
basePolicyName string
Name of the base Content Filters.
completionBlocklists RaiBlocklistConfig[]
The list of blocklists for completion.
contentFilters RaiPolicyContentFilter[]
The list of Content Filters.
mode string | RaiPolicyMode
Content Filters mode.
promptBlocklists RaiBlocklistConfig[]
The list of blocklists for prompt.
base_policy_name str
Name of the base Content Filters.
completion_blocklists Sequence[RaiBlocklistConfig]
The list of blocklists for completion.
content_filters Sequence[RaiPolicyContentFilter]
The list of Content Filters.
mode str | RaiPolicyMode
Content Filters mode.
prompt_blocklists Sequence[RaiBlocklistConfig]
The list of blocklists for prompt.
basePolicyName String
Name of the base Content Filters.
completionBlocklists List<Property Map>
The list of blocklists for completion.
contentFilters List<Property Map>
The list of Content Filters.
mode String | "Default" | "Deferred" | "Blocking"
Content Filters mode.
promptBlocklists List<Property Map>
The list of blocklists for prompt.

RaiPolicyPropertiesResponse
, RaiPolicyPropertiesResponseArgs

PolicyType This property is required. string
Content Filters policy type.
BasePolicyName string
Name of the base Content Filters.
CompletionBlocklists List<Pulumi.AzureNative.CognitiveServices.Inputs.RaiBlocklistConfigResponse>
The list of blocklists for completion.
ContentFilters List<Pulumi.AzureNative.CognitiveServices.Inputs.RaiPolicyContentFilterResponse>
The list of Content Filters.
Mode string
Content Filters mode.
PromptBlocklists List<Pulumi.AzureNative.CognitiveServices.Inputs.RaiBlocklistConfigResponse>
The list of blocklists for prompt.
PolicyType This property is required. string
Content Filters policy type.
BasePolicyName string
Name of the base Content Filters.
CompletionBlocklists []RaiBlocklistConfigResponse
The list of blocklists for completion.
ContentFilters []RaiPolicyContentFilterResponse
The list of Content Filters.
Mode string
Content Filters mode.
PromptBlocklists []RaiBlocklistConfigResponse
The list of blocklists for prompt.
policyType This property is required. String
Content Filters policy type.
basePolicyName String
Name of the base Content Filters.
completionBlocklists List<RaiBlocklistConfigResponse>
The list of blocklists for completion.
contentFilters List<RaiPolicyContentFilterResponse>
The list of Content Filters.
mode String
Content Filters mode.
promptBlocklists List<RaiBlocklistConfigResponse>
The list of blocklists for prompt.
policyType This property is required. string
Content Filters policy type.
basePolicyName string
Name of the base Content Filters.
completionBlocklists RaiBlocklistConfigResponse[]
The list of blocklists for completion.
contentFilters RaiPolicyContentFilterResponse[]
The list of Content Filters.
mode string
Content Filters mode.
promptBlocklists RaiBlocklistConfigResponse[]
The list of blocklists for prompt.
policy_type This property is required. str
Content Filters policy type.
base_policy_name str
Name of the base Content Filters.
completion_blocklists Sequence[RaiBlocklistConfigResponse]
The list of blocklists for completion.
content_filters Sequence[RaiPolicyContentFilterResponse]
The list of Content Filters.
mode str
Content Filters mode.
prompt_blocklists Sequence[RaiBlocklistConfigResponse]
The list of blocklists for prompt.
policyType This property is required. String
Content Filters policy type.
basePolicyName String
Name of the base Content Filters.
completionBlocklists List<Property Map>
The list of blocklists for completion.
contentFilters List<Property Map>
The list of Content Filters.
mode String
Content Filters mode.
promptBlocklists List<Property Map>
The list of blocklists for prompt.

SystemDataResponse
, SystemDataResponseArgs

CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.
createdAt string
The timestamp of resource creation (UTC).
createdBy string
The identity that created the resource.
createdByType string
The type of identity that created the resource.
lastModifiedAt string
The timestamp of resource last modification (UTC)
lastModifiedBy string
The identity that last modified the resource.
lastModifiedByType string
The type of identity that last modified the resource.
created_at str
The timestamp of resource creation (UTC).
created_by str
The identity that created the resource.
created_by_type str
The type of identity that created the resource.
last_modified_at str
The timestamp of resource last modification (UTC)
last_modified_by str
The identity that last modified the resource.
last_modified_by_type str
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:cognitiveservices:RaiPolicy raiPolicyName /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi