以terraform在azure ML studio中创建数据存储



尝试在Azure ML studio中以terraform:创建数据存储

resource "azureml_datastore" "output_datastore" {
resource_group_name = var.resource_group_name
workspace_name      = azurerm_machine_learning_workspace.AML.name
name                = "outputdatastore"
storage_type        = "AzureBlob"

storage_account_name   = "bapstorageaccount945"
storage_container_name = "predictioncontainer"
auth {
credentials_type = "AccountKey"
account_key = "storage account primary key"
}  
}

它抛出以下错误:

│错误:缺少必需的参数││论点";tenant_id";是必需的,但未设置。╵╷│错误:缺少必需的参数││论点";client_id";是必需的,但未设置。╵╷│错误:缺少必需的参数││论点";client_secret";是必需的,但未设置。╵╷│错误:缺少必需的参数││论点";subscription_id";是必需的,但未设置。

当我添加以上属性时:

resource "azureml_datastore" "output_datastore" {
resource_group_name = var.resource_group_name
workspace_name      = azurerm_machine_learning_workspace.AML.name
name                = "outputdatastore"
storage_type        = "AzureBlob"

storage_account_name   = "bapstorageaccount945"
storage_container_name = "predictioncontainer"
auth {
credentials_type = "AccountKey"
tenant_id = "XXXX"
client_id = "Storage Account ID"
client_secret = "storage account primary key"
subscription_id = "XXXX"
account_key = "storage account primary key"
} 

我得到以下错误:

│ Error: Unsupported argument
│ 
│   on MLStudiomain.tf line 74, in resource "azureml_datastore" "output_datastore":
│   74:     subscription_id = "XXXX"
│ 
│ An argument named "subscription_id" is not expected here.

有人能帮我吗?

缺少的参数错误适用于provider块,而不是资源块:

provider "azureml" {
client_id       = "Storage Account ID"
client_secret   = "storage account primary key"
tenant_id       = "XXXX"
subscription_id = "XXXX"
}

您可以查看文档以了解更多信息。

最新更新