Home > database >  creating datastore in azure ML studio in terraform
creating datastore in azure ML studio in terraform

Time:09-13

Trying to create a datastore in Azure ML studio in 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"
  }  
}

It is throwing following error:

│ Error: Missing required argument │ │ The argument "tenant_id" is required, but was not set. ╵ ╷ │ Error: Missing required argument │ │ The argument "client_id" is required, but was not set. ╵ ╷ │ Error: Missing required argument │ │ The argument "client_secret" is required, but was not set. ╵ ╷ │ Error: Missing required argument │ │ The argument "subscription_id" is required, but was not set.

When I add the above attributes:

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"
  } 

I get following error:

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

Can somebody help me on this?

CodePudding user response:

The missing arguments errors are for the provider block and not for the resource block:

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

You can check the documentation for more information.

  • Related