Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for Microsoft.CognitiveServices_accounts_raiPolicies@2024-10-01 #767

Merged
merged 3 commits into from
Feb 18, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}

provider "azapi" {
skip_provider_registration = false
}

variable "resource_name" {
type = string
default = "acctest0003"
}

variable "location" {
type = string
default = "eastus"
}

resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}

resource "azapi_resource" "account" {
type = "Microsoft.CognitiveServices/accounts@2022-10-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location

body = {
identity = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the identity block inside the body

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

type = "None"
userAssignedIdentities = null
}
kind = "OpenAI"
properties = {
disableLocalAuth = false
dynamicThrottlingEnabled = false
publicNetworkAccess = "Enabled"
restrictOutboundNetworkAccess = false
}
sku = {
name = "S0"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}

resource "azapi_resource" "raiPolicies" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the label to raiPolicy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

type = "Microsoft.CognitiveServices/accounts/raiPolicies@2024-10-01"
name = "NoModerationPolicy"
parent_id = azapi_resource.account.id

body = {
properties = {
basePolicyName = "Microsoft.Default"
contentFilters = [
{
blocking = true
enabled = true
name = "Hate"
severityThreshold = "High"
source = "Prompt"
}
]
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
Loading