繁体   English   中英

使用 Terraform 创建 Azure Synapse 池时出错

[英]Error creating Azure Synapse Pool with Terraform

我只是尝试使用 Terraform 创建 Azure Synapse 分析池。 我几乎可以创建我需要的所有其他资源,但是在存储帐户中创建 FileSystem 会导致问题(我需要一个文件系统,因为突触池需要一个需要文件系统的工作区)。 我收到如下错误: 在此处输入图片说明

以下是我的脚本,有人成功完成了吗?:

# Configure the Microsoft Azure Provider.
terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = ">= 2.26"
    }
  }
}

provider "azurerm" {
  features {}
}


# Create a resource group
resource "azurerm_resource_group" "rg" {
  name     = "kjTEST"
  location = "eastus"
}



#** Storage account ** will most likely replace with references to existing storage accounts
resource "azurerm_storage_account" "storage" {
  name                     = "kjastoragetest"
  resource_group_name      = azurerm_resource_group.rg.name
  location                 = azurerm_resource_group.rg.location
  account_tier             = "Standard"
  is_hns_enabled           = "true"
  account_replication_type = "LRS"
  account_kind             = "StorageV2"
}

resource "azurerm_storage_container" "container" {
  name                  = "testcontainer"
  storage_account_name  = azurerm_storage_account.storage.name
  container_access_type = "blob"
}

# File system
resource "azurerm_storage_data_lake_gen2_filesystem" "filesystem" {
  name               = "filesystem"
  storage_account_id = azurerm_storage_account.storage.id
}

# Synapse 
resource "azurerm_synapse_workspace" "workspace" {
  name                                 = "example"
  resource_group_name                  = azurerm_resource_group.rg.name
  location                             = azurerm_resource_group.rg.location
  storage_data_lake_gen2_filesystem_id = azurerm_storage_data_lake_gen2_filesystem.filesystem.id
  sql_administrator_login              = "usnername89"
  sql_administrator_login_password     = "########"
}

# 
resource "azurerm_synapse_sql_pool" "synapsepool" {
  name                 = "kjatestsqlpool"
  synapse_workspace_id = azurerm_synapse_workspace.workspace.id
  sku_name             = "DW100c"
  create_mode          = "Default"
}

若要在 Azure Synapse 工作区中成功启动 Spark 池,Azure Synapse 托管标识需要此存储帐户上的Storage Blob Data Contributor角色。

参考: 向 ADLS Gen2 存储帐户授予托管标识权限

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM