0

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?

Manoj R
  • 57
  • 6

1 Answers1

0

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.

Matthew Schuchard
  • 25,172
  • 3
  • 47
  • 67
  • Thank you so much for the response. i will fix it. 1 more question- what should be entered for client_id and client_secret? – Manoj R Sep 13 '22 at 04:56
  • @ManojR Sure, feel free to ask that additional question and we will attempt to answer it, and please consider accept and upvote since this solved your question. – Matthew Schuchard Sep 13 '22 at 10:47