subscription_rai_policy
Creates, updates, deletes, gets or lists a subscription_rai_policy resource.
Overview
| Name | subscription_rai_policy |
| Type | Resource |
| Id | azure.cognitive_services.subscription_rai_policy |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
basePolicyName | string | Name of Rai policy. |
contentFilters | array | The list of Content Filters. |
customBlocklists | array | The list of custom Blocklist. |
egressPolicy | object | Egress (outbound network) policy controlling which external endpoints sandboxed agents can reach. Includes rules with Allow/Deny/Transform/Rewrite actions. |
etag | string | Resource Etag. |
mode | string | Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2025-06-01. It is the same as 'Deferred' in previous version. Known values are: "Default", "Deferred", "Blocking", and "Asynchronous_filter". (Default, Deferred, Blocking, Asynchronous_filter) |
safetyProviders | array | The list of Safety Providers. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | rai_policy_name, subscription_id | Gets the specified Content Filters associated with the Subscription. | |
create_or_update | insert | rai_policy_name, subscription_id | Update the state of specified Content Filters associated with the subscription. | |
create_or_update | replace | rai_policy_name, subscription_id | Update the state of specified Content Filters associated with the subscription. | |
delete | delete | rai_policy_name, subscription_id | Deletes the specified Content Filters associated with the subscription. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
rai_policy_name | string | The name of the RaiPolicy associated with the Cognitive Services Account. Required. |
subscription_id | string |
SELECT examples
- get
Gets the specified Content Filters associated with the Subscription.
SELECT
id,
name,
basePolicyName,
contentFilters,
customBlocklists,
egressPolicy,
etag,
mode,
safetyProviders,
systemData,
tags,
type
FROM azure.cognitive_services.subscription_rai_policy
WHERE rai_policy_name = '{{ rai_policy_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Update the state of specified Content Filters associated with the subscription.
INSERT INTO azure.cognitive_services.subscription_rai_policy (
properties,
tags,
rai_policy_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ rai_policy_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: subscription_rai_policy
props:
- name: rai_policy_name
value: "{{ rai_policy_name }}"
description: Required parameter for the subscription_rai_policy resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the subscription_rai_policy resource.
- name: properties
description: |
Properties of Cognitive Services RaiPolicy.
value:
type: "{{ type }}"
mode: "{{ mode }}"
basePolicyName: "{{ basePolicyName }}"
contentFilters:
- name: "{{ name }}"
enabled: {{ enabled }}
severityThreshold: "{{ severityThreshold }}"
blocking: {{ blocking }}
source: "{{ source }}"
action: "{{ action }}"
customBlocklists:
- blocklistName: "{{ blocklistName }}"
blocking: {{ blocking }}
source: "{{ source }}"
safetyProviders:
- safetyProviderName: "{{ safetyProviderName }}"
blocking: {{ blocking }}
source: "{{ source }}"
egressPolicy:
mode: "{{ mode }}"
defaultAction: "{{ defaultAction }}"
description: "{{ description }}"
rules:
- name: "{{ name }}"
description: "{{ description }}"
ruleType: "{{ ruleType }}"
match:
host: "{{ host }}"
path: "{{ path }}"
action:
actionType: "{{ actionType }}"
headers:
- operation: "{{ operation }}"
name: "{{ name }}"
value: "{{ value }}"
valueRef:
secretRef: "{{ secretRef }}"
managedIdentityRef: "{{ managedIdentityRef }}"
rewrite:
scheme: "{{ scheme }}"
host: "{{ host }}"
path: "{{ path }}"
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
REPLACE examples
- create_or_update
Update the state of specified Content Filters associated with the subscription.
REPLACE azure.cognitive_services.subscription_rai_policy
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
rai_policy_name = '{{ rai_policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
properties,
systemData,
tags,
type;
DELETE examples
- delete
Deletes the specified Content Filters associated with the subscription.
DELETE FROM azure.cognitive_services.subscription_rai_policy
WHERE rai_policy_name = '{{ rai_policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;