无法在Azure Data Explorer群集中附加数据库

pw136qt2  于 2023-08-07  发布在  其他
关注(0)|答案(1)|浏览(100)

我已经创建了ADX(Azure数据资源管理器)集群,比如说集群2。我正在尝试从ADX集群(例如集群1)附加一个数据库(例如Db1),该数据库带有Terraform和Azure Devops。
但是,当Terraform执行azurerm_kusto_attached_database_configuration时,我得到以下错误:
有什么不对或缺失?这个错误意味着什么?

│ Error: creating/updating Attached Database Configuration (Subscription: "xx"
│ Resource Group Name: "x-rg"
│ Cluster Name: "x"
│ Attached Database Configuration Name: "x"): polling after CreateOrUpdate: Code="Failed" Message="Internal Server Error"
│
│   with module.labs_kusto.azurerm_kusto_attached_database_configuration.this["x"],
│   in resource "azurerm_kusto_attached_database_configuration" "this":

字符串

wwwo4jvm

wwwo4jvm1#

您可以利用Terraform中的data块来使用/引用现有ADX群集或当前代码中的任何资源。

  • 内部服务器只是暂时的问题。这些可能是由于网络问题而发生的;您可以查看群集设置并重试部署。检查现有的群集权限,并在需要时启用必要的权限。*

通过参考示例terraform注册表模板,我修改了它,如下所示,以实现您的要求。

data "azurerm_resource_group" "example" {
  name     = "caro"
}

resource "azurerm_kusto_cluster" "follower_cluster" {
  name                = "cluster100"
  location            = data.azurerm_resource_group.example.location
  resource_group_name = data.azurerm_resource_group.example.name
  sku {
    name     = "Dev(No SLA)_Standard_D11_v2"
    capacity = 1
  }
}

data "azurerm_kusto_cluster" "followed_cluster" {
  name                = "cluster31"
  resource_group_name = data.azurerm_resource_group.example.name
}

resource "azurerm_kusto_database" "followed_database" {
  name                = "blabla"
  resource_group_name = data.azurerm_resource_group.example.name
  location            = data.azurerm_resource_group.example.location
  cluster_name        = azurerm_kusto_cluster.follower_cluster.name
}

resource "azurerm_kusto_database" "example" {
  name                = "examplexxxx"
  resource_group_name = data.azurerm_resource_group.example.name
  location            = data.azurerm_resource_group.example.location
  cluster_name        = azurerm_kusto_cluster.follower_cluster.name
}

resource "azurerm_kusto_attached_database_configuration" "example" {
  name                = "configuration1"
  resource_group_name = data.azurerm_resource_group.example.name
  location            = data.azurerm_resource_group.example.location
  cluster_name        = azurerm_kusto_cluster.follower_cluster.name
  cluster_resource_id = data.azurerm_kusto_cluster.followed_cluster.id
  database_name       = azurerm_kusto_database.example.name

  sharing {
    external_tables_to_exclude    = ["ExternalTablex"]
    external_tables_to_include    = ["ExternalTabley"]
    materialized_views_to_exclude = ["MaterializedViewTablex"]
    materialized_views_to_include = ["MaterializedViewTabley"]
    tables_to_exclude             = ["Tablex"]
    tables_to_include             = ["Tabley"]
  }
}

字符串

  • 初始化terraform配置成功:*

x1c 0d1x的数据

  • 已执行 * terraform plan


  • 部署成功:*



相关问题