Problem
Error: cannot create metastore: Invalid resource ID
Error: Invalid resource ID
│
│ with module.databricks,
│ on ./main.tf line 7, in resource "databricks_metastore" "example":
│ 7: resource "databricks_metastore" "example" {
Cause
When authenticating with a Service Principal in Azure a workspace resource ID is required in the Databricks provider block. There may be some confusion around the workspace ID as there are multiple versions. There is workspace_id
and then id
which is the resource ID. When the wrong ID is provided this will cause the Invalid resource ID
error.
Solutions:
The full path to the resource on Azure is required for the azure_workspace_resource_id
in the Databricks provider block. An example is "/subscriptions/redacted/resourceGroups/example-resources-test/providers/Microsoft.Databricks/workspaces/databricks-test"
instead of the workspace_id
which is a set of numbers.
provider "databricks" {
azure_workspace_resource_id = "/subscriptions/redacted/resourceGroups/example-resources-test/providers/Microsoft.Databricks/workspaces/databricks-test"
# azure_workspace_resource_id = "3654489030985684"
host = "abc.123.azuredatabricks.net"
}