使用 Terraform 创建 Azure Synapse 池时出错

Error creating Azure Synapse Pool with Terraform

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

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

# 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 角色。

参考: Grant the managed identity permissions to ADLS Gen2 storage account