akhil7886
akhil7886

Reputation: 11

Azure Databricks Provisioning failed from Terraform

Trying to create a new databricks workspace on Azure from Terraform. I tried with custom parameters and without custom parameters. Both are failing. Azure Activity Log shows the below error.

"statusMessage": "{status:Failed,error:{code:ResourceOperationFailure,message:The resource operation completed with terminal provisioning state 'Failed'.,details:[{code:Conflict,message:INVALID_STATE: Workspace xyz is missing metadata necessary for cluster management. Please reach out to your Databricks support.}]}}"

Below is the simple code I used.

resource "azurerm_databricks_workspace" "databricks" {
  name                      =       "${lower(var.prefix)}-${var.tenant-name}-${var.env}-dbr-ws"
  resource_group_name       =       data.azurerm_resource_group.rg.name
  location                  =       data.azurerm_resource_group.rg.location
  sku                       =       var.databricksVars["sku"]
  managed_resource_group_name   =   "${lower(var.prefix)}-${var.tenant-name}-${var.env}-dbr-managed-rg"

  # custom_parameters {
  # public_subnet_name        =       data.azurerm_subnet.public.name
  # public_subnet_network_security_group_association_id   =   data.azurerm_subnet.public.id
  # private_subnet_name       =       data.azurerm_subnet.private.name
  # private_subnet_network_security_group_association_id  =   data.azurerm_subnet.private.id
  # virtual_network_id        =       data.azurerm_virtual_network.vnet.id
  # }      

  tags = {
        app = var.tenant-name
        created_by = "xyz"
        created_on = "9-May-2023"
        env = "dev"
        created_from = "terraform"
  }
}

Please help me resolve this.

I tried with custom parameters and without custom parameters. Both are failing

Upvotes: 0

Views: 706

Answers (1)

kavya Saraboju
kavya Saraboju

Reputation: 10831

Check the following:

Code:

resource "azurerm_databricks_workspace" "example" {
  name                = "databricks-test"
  location            = data.azurerm_resource_group.example.location
  resource_group_name = data.azurerm_resource_group.example.name
  sku                 = "standard"
managed_resource_group_name = azurerm_resource_group.rg.name
 
}

Make sure to have necessary permissions in your subscription to create a workspace and managed resource group . SKU must be supported by Databricks service in the region .

You must have azure pay-as-you go subscription.

Make sure to have Azure Contributor or Owner role to you.

Make sure managed_resource_group_name field is unique .

enter image description here

enter image description here

enter image description here

Reference : azurerm_databricks_workspace | terraform registry

Upvotes: 0

Related Questions