Using databricks workspace in the same configuration as the databricks provider

Josh Robinson 21 Reputation points
2021-05-06T18:49:57.21+00:00

I'm having some trouble getting the azurerm & databricks provider to work together.

With the azurerm provider, setup my workspace

resource "azurerm_databricks_workspace" "ws" {
  name                        = var.workspace_name
  resource_group_name         = azurerm_resource_group.rg.name
  location                    = azurerm_resource_group.rg.location
  sku                         = "premium"
  managed_resource_group_name = "${azurerm_resource_group.rg.name}-mng-rg"
  custom_parameters {
    virtual_network_id  = data.azurerm_virtual_network.vnet.id
    public_subnet_name  = var.public_subnet
    private_subnet_name = var.private_subnet
  }
}

No matter how I structure this, I can't say seem to get the azurerm_databricks_workspace.ws.id to work in the provider statement for databricks in the the same configuration. If it did work, the above workspace would be defined in the same configuration and I'd have a provider statement that looks like this:

provider "databricks" {
  azure_workspace_resource_id = azurerm_databricks_workspace.ws.id
}

I've tried in the same configuration & in a module and consuming outputs. The only way I can get it to work is by running one configuration for the workspace and a second configuration to consume the workspace.

This is super suboptimal in that I have a fair amount of repeating values across those configurations and it would be ideal just to have one.

Has anyone been able to do this? Thank you :)

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,517 questions
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA 90,641 Reputation points Moderator
    2021-05-11T03:47:19.703+00:00

    Hello @Josh Robinson ,

    From the error message, it looks like Authentication is not configured for provider could you please configure it through the one of following options mentioned above.

    For more details, refer Databricks provider - Authentication.

    For passing the custom_parameters, you may checkout the SO thread which addressing the similar issue.

    In case if you need more help on this issue, I would suggest to open an issue here: https://github.com/terraform-providers/terraform-provider-azurerm/issues

    Hope this helps. Do let us know if you any further queries.

    ------------

    Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.