skip to Main Content

Bing.search.v7 is not getting created through either Terraform or AZ CLI

I want to create bing.search.v7 in the portal either through Terraform or AZ CLI. The Terraform earlier had support for it under Cognitive Services, but now it has moved out of it and currently not supported by Terraform. I tried using AZ CLI also but to no avail. Is there any way I can create the above mentioned resources by these two ways? If not what is the possible solution for it?

2

Answers


  1. We have tried deploying the Bing Search V7 by keeping the kind value and by using the this sample terraform template shared here and it got failed.

    As mentioned in this documentation,Starting from October 2022 Bing Search APIs are moving from Cognitive Services to Bing Search Services.

    You can deploy the Bing Web Seach API V7 using either through portal or through ARM template successfully Here is the sample ARM template I have used

    {
        "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {},
        "functions": [],
        "variables": {},
        "resources": [
            {
                "type":"Microsoft.Bing/accounts",
                "apiversion":"2020-06-10",
                "location":"Global",
                "name":"<BingSearchName>",
                "sku":{
                    "name":"S1"
                },
                "Kind":"Bing.Search.v7",
                "properties":{
                    "statisticsEnabled":false
                }
    
            }
        ],
        "outputs": {}
    }
    
    Login or Signup to reply.
  2. I’ve managed to deploy the BingSearch.v7 through Terraform using the following:

        resource "azurerm_resource_group_template_deployment" "main" {
      name                = var.cognitive_service_name
      resource_group_name = var.cognitive_service_resource_group_name
      deployment_mode     = "Incremental"
      parameters_content = jsonencode({
        "name" = {
          value = var.cognitive_service_name
        },
        "location" = {
          value = "Global"
        },
        "sku" = {
          value = var.sku_name
        },
        "kind" = {
          value = var.kind
        }
      })
      template_content = <<TEMPLATE
    {
        "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
            "name": {
                "type": "String"
            },
            "location": {
                "type": "String"
            },
            "sku": {
                "type": "String"
            },
            "kind": {
              "type": "String"
            }
    
        },
        "resources": [
            {
                "apiVersion": "2020-06-10",
                "name": "[parameters('name')]",
                "location": "[parameters('location')]",
                "type": "Microsoft.Bing/accounts",
                "kind": "[parameters('kind')]",
                "sku": {
                    "name": "[parameters('sku')]"
                }
            }
        ]
        
    }
    TEMPLATE
    
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search