0
votes

I am trying to create a Azure Cognitive Service using terraform but getting the below error. Even though we we are trying to create a "All Cognitive Services" type cognitive service the errror seems to be around QnA. Any suggestions ?

resource "azurerm_cognitive_account" "azfn-rg" {
  name                = var.azurerm_cognitive_account_name
  location            = azurerm_resource_group.azfn-rg.location
  resource_group_name = azurerm_resource_group.azfn-rg.name
  kind                = "CognitiveServices"

  sku_name = "S0"

  tags = var.tags

}

Below is the error:

cognitiveservices.AccountsClient#Create: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="ApiPropertiesInvalid" Message="The given 'apiProperties' '{\r\n "qnaRuntimeEndpoint": ""\r\n}' is invalid. Validation errors: Property 'qnaRuntimeEndpoint' has not been defined and the schema does not allow additional properties. Path 'apiProperties.qnaRuntimeEndpoint'."

1

1 Answers

0
votes

I can reproduce this error.

To fix it, you can pin the version of provider "azurerm" like this. I am using Terraform v0.12.28+ provider.azurerm v2.0.0.

provider "azurerm" {

  version           = "=2.0.0"
  features {}

}

Result

enter image description here