diff --git a/common/client_test.go b/common/client_test.go index 72b56a5c66..42185d760a 100644 --- a/common/client_test.go +++ b/common/client_test.go @@ -39,8 +39,7 @@ func TestDatabricksClientConfigure_Nothing(t *testing.T) { DatabricksClient: &client.DatabricksClient{ Config: &config.Config{}, }, - }, - "authentication is not configured for provider") + }, "default auth: cannot configure default credentials") } func TestDatabricksClientConfigure_BasicAuth_NoHost(t *testing.T) { @@ -52,7 +51,7 @@ func TestDatabricksClientConfigure_BasicAuth_NoHost(t *testing.T) { Password: "bar", }, }, - }, "authentication is not configured for provider.") + }, "default auth: cannot configure default credentials") } func TestDatabricksClientConfigure_BasicAuth(t *testing.T) { @@ -92,7 +91,7 @@ func TestDatabricksClientConfigure_Token_NoHost(t *testing.T) { Token: "dapi345678", }, }, - }, "authentication is not configured for provider.") + }, "default auth: cannot configure default credentials") } func TestDatabricksClientConfigure_HostTokensTakePrecedence(t *testing.T) { @@ -135,7 +134,7 @@ func TestDatabricksClientConfigure_ConfigRead(t *testing.T) { }, }) assert.NoError(t, err) - assert.Equal(t, "databricks-cli", dc.Config.AuthType) + assert.Equal(t, "pat", dc.Config.AuthType) assert.Equal(t, "PT0+IC9kZXYvdXJhbmRvbSA8PT0KYFZ", dc.Config.Token) } @@ -148,8 +147,8 @@ func TestDatabricksClientConfigure_NoHostGivesError(t *testing.T) { Profile: "nohost", }, }, - }, "cannot configure databricks-cli auth: config file "+ - "testdata/.databrickscfg is corrupt: cannot find host in nohost profile.") + }, "default auth: cannot configure default credentials. "+ + "Config: token=***, profile=nohost, config_file=testdata/.databrickscfg") } func TestDatabricksClientConfigure_NoTokenGivesError(t *testing.T) { @@ -174,8 +173,8 @@ func TestDatabricksClientConfigure_InvalidProfileGivesError(t *testing.T) { Profile: "invalidhost", }, }, - }, "cannot configure databricks-cli auth: testdata/.databrickscfg "+ - "has no invalidhost profile configured") + }, "resolve: testdata/.databrickscfg has no invalidhost profile configured. "+ + "Config: token=***, profile=invalidhost, config_file=testdata/.databrickscfg") } func TestDatabricksClientConfigure_MissingFile(t *testing.T) { @@ -187,7 +186,7 @@ func TestDatabricksClientConfigure_MissingFile(t *testing.T) { Profile: "invalidhost", }, }, - }, "authentication is not configured for provider.") + }, "default auth: cannot configure default credentials.") } func TestDatabricksClientConfigure_InvalidConfigFilePath(t *testing.T) { @@ -199,7 +198,7 @@ func TestDatabricksClientConfigure_InvalidConfigFilePath(t *testing.T) { Profile: "invalidhost", }, }, - }, "cannot configure databricks-cli auth: cannot parse config file") + }, `resolve: cannot parse config file`) } func TestDatabricksClient_FormatURL(t *testing.T) { @@ -312,7 +311,7 @@ func TestDatabricksClientConfigure_NonsenseAuth(t *testing.T) { AuthType: "nonsense", }, }, - }, "cannot configure nonsense auth.") + }, "default auth: cannot configure default credentials") } func TestConfigAttributeSetNonsense(t *testing.T) { @@ -321,50 +320,3 @@ func TestConfigAttributeSetNonsense(t *testing.T) { }).Set(&DatabricksClient{}, 1) assert.EqualError(t, err, "cannot set of unknown type Chan") } - -func TestDatabricksClientFixHost(t *testing.T) { - hostForInput := func(in string) (string, error) { - client := &DatabricksClient{ - DatabricksClient: &client.DatabricksClient{ - Config: &config.Config{ - Host: in, - }, - }, - } - return client.Config.Host, nil - } - - { - // Strip trailing slash. - out, err := hostForInput("https://accounts.gcp.databricks.com/") - assert.Nil(t, err) - assert.Equal(t, out, "https://accounts.gcp.databricks.com") - } - - { - // Keep port. - out, err := hostForInput("https://accounts.gcp.databricks.com:443") - assert.Nil(t, err) - assert.Equal(t, out, "https://accounts.gcp.databricks.com:443") - } - - { - // Default scheme. - out, err := hostForInput("accounts.gcp.databricks.com") - assert.Nil(t, err) - assert.Equal(t, out, "https://accounts.gcp.databricks.com") - } - - { - // Default scheme with port. - out, err := hostForInput("accounts.gcp.databricks.com:443") - assert.Nil(t, err) - assert.Equal(t, out, "https://accounts.gcp.databricks.com:443") - } - - { - // Return error. - _, err := hostForInput("://@@@accounts.gcp.databricks.com/") - assert.NotNil(t, err) - } -} diff --git a/docs/data-sources/catalogs.md b/docs/data-sources/catalogs.md index ca7cbb0580..1221a2565c 100644 --- a/docs/data-sources/catalogs.md +++ b/docs/data-sources/catalogs.md @@ -3,7 +3,7 @@ subcategory: "Unity Catalog" --- # databricks_catalogs Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves a list of [databricks_catalog](../resources/catalog.md) ids, that were created by Terraform or manually, so that special handling could be applied. diff --git a/docs/data-sources/cluster.md b/docs/data-sources/cluster.md index 30d500b8f3..aa5fd4d8e0 100644 --- a/docs/data-sources/cluster.md +++ b/docs/data-sources/cluster.md @@ -3,7 +3,7 @@ subcategory: "Compute" --- # databricks_cluster Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves information about a [databricks_cluster](../resources/cluster.md) using its id. This could be retrieved programmatically using [databricks_clusters](../data-sources/clusters.md) data source. diff --git a/docs/data-sources/cluster_policy.md b/docs/data-sources/cluster_policy.md index bdba93b13c..e7561b19e2 100644 --- a/docs/data-sources/cluster_policy.md +++ b/docs/data-sources/cluster_policy.md @@ -4,7 +4,7 @@ subcategory: "Compute" # databricks_cluster_policy Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves information about [databricks_cluster_policy](../resources/cluster_policy.md). diff --git a/docs/data-sources/clusters.md b/docs/data-sources/clusters.md index 373144e842..81ab775ecb 100644 --- a/docs/data-sources/clusters.md +++ b/docs/data-sources/clusters.md @@ -3,7 +3,7 @@ subcategory: "Compute" --- # databricks_clusters Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves a list of [databricks_cluster](../resources/cluster.md#cluster_id) ids, that were created by Terraform or manually, with or without [databricks_cluster_policy](../resources/cluster_policy.md). diff --git a/docs/data-sources/current_user.md b/docs/data-sources/current_user.md index 3acbaceb37..24a2f50e3b 100644 --- a/docs/data-sources/current_user.md +++ b/docs/data-sources/current_user.md @@ -3,7 +3,7 @@ subcategory: "Security" --- # databricks_current_user Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves information about [databricks_user](../resources/user.md) or [databricks_service_principal](../resources/service_principal.md), that is calling Databricks REST API. Might be useful in applying the same Terraform by different users in the shared workspace for testing purposes. diff --git a/docs/data-sources/dbfs_file.md b/docs/data-sources/dbfs_file.md index 57fea3ca67..9f87ce321d 100644 --- a/docs/data-sources/dbfs_file.md +++ b/docs/data-sources/dbfs_file.md @@ -3,7 +3,7 @@ subcategory: "Storage" --- # databricks_dbfs_file Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. This data source allows to get file content from [Databricks File System (DBFS)](https://docs.databricks.com/data/databricks-file-system.html). diff --git a/docs/data-sources/dbfs_file_paths.md b/docs/data-sources/dbfs_file_paths.md index 24cb4f51d7..c43340d9c8 100644 --- a/docs/data-sources/dbfs_file_paths.md +++ b/docs/data-sources/dbfs_file_paths.md @@ -3,7 +3,7 @@ subcategory: "Storage" --- # databricks_dbfs_file_paths Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. This data source allows to get list of file names from get file content from [Databricks File System (DBFS)](https://docs.databricks.com/data/databricks-file-system.html). diff --git a/docs/data-sources/directory.md b/docs/data-sources/directory.md index 718481e64d..21340ce774 100644 --- a/docs/data-sources/directory.md +++ b/docs/data-sources/directory.md @@ -3,7 +3,7 @@ subcategory: "Workspace" --- # databricks_directory Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. This data source allows to get information about a directory in a Databricks Workspace. diff --git a/docs/data-sources/group.md b/docs/data-sources/group.md index 0fb55ffe34..dfa1c7efb6 100644 --- a/docs/data-sources/group.md +++ b/docs/data-sources/group.md @@ -3,7 +3,7 @@ subcategory: "Security" --- # databricks_group Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves information about [databricks_group](../resources/group.md) members, entitlements and instance profiles. diff --git a/docs/data-sources/instance_pool.md b/docs/data-sources/instance_pool.md index 1a1cd677a3..7cb92a183a 100644 --- a/docs/data-sources/instance_pool.md +++ b/docs/data-sources/instance_pool.md @@ -4,7 +4,7 @@ subcategory: "Compute" # databricks_instance_pool Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves information about [databricks_instance_pool](../resources/instance_pool.md). diff --git a/docs/data-sources/job.md b/docs/data-sources/job.md index 58282a5fb4..3565a77667 100755 --- a/docs/data-sources/job.md +++ b/docs/data-sources/job.md @@ -3,7 +3,7 @@ subcategory: "Compute" --- # databricks_job Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves the settings of [databricks_job](../resources/job.md) by name or by id. Complements the feature of the [databricks_jobs](jobs.md) data source. diff --git a/docs/data-sources/jobs.md b/docs/data-sources/jobs.md index ed2f4709c0..e82556088b 100644 --- a/docs/data-sources/jobs.md +++ b/docs/data-sources/jobs.md @@ -3,7 +3,7 @@ subcategory: "Compute" --- # databricks_jobs Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves a list of [databricks_job](../resources/job.md) ids, that were created by Terraform or manually, so that special handling could be applied. diff --git a/docs/data-sources/mws_credentials.md b/docs/data-sources/mws_credentials.md index 30659957ee..1e80fc0014 100755 --- a/docs/data-sources/mws_credentials.md +++ b/docs/data-sources/mws_credentials.md @@ -3,7 +3,7 @@ subcategory: "AWS" --- # databricks_mws_credentials Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Lists all [databricks_mws_credentials](../resources/mws_credentials.md) in Databricks Account. diff --git a/docs/data-sources/mws_workspaces.md b/docs/data-sources/mws_workspaces.md index 5358eea7a2..de237dae63 100755 --- a/docs/data-sources/mws_workspaces.md +++ b/docs/data-sources/mws_workspaces.md @@ -3,7 +3,7 @@ subcategory: "Deployment" --- # databricks_mws_workspaces Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Lists all [databricks_mws_workspaces](../resources/mws_workspaces.md) in Databricks Account. diff --git a/docs/data-sources/node_type.md b/docs/data-sources/node_type.md index 91f045dd85..bcb1a36f4b 100644 --- a/docs/data-sources/node_type.md +++ b/docs/data-sources/node_type.md @@ -3,7 +3,7 @@ subcategory: "Compute" --- # databricks_node_type Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Gets the smallest node type for [databricks_cluster](../resources/cluster.md) that fits search criteria, like amount of RAM or number of cores. [AWS](https://databricks.com/product/aws-pricing/instance-types) or [Azure](https://azure.microsoft.com/en-us/pricing/details/databricks/). Internally data source fetches [node types](https://docs.databricks.com/dev-tools/api/latest/clusters.html#list-node-types) available per cloud, similar to executing `databricks clusters list-node-types`, and filters it to return the smallest possible node with criteria. diff --git a/docs/data-sources/notebook.md b/docs/data-sources/notebook.md index 045ef11a72..7af6ce4a25 100644 --- a/docs/data-sources/notebook.md +++ b/docs/data-sources/notebook.md @@ -3,7 +3,7 @@ subcategory: "Workspace" --- # databricks_notebook Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. This data source allows to export a notebook from Databricks Workspace. diff --git a/docs/data-sources/notebook_paths.md b/docs/data-sources/notebook_paths.md index c0d6b55156..382434770d 100644 --- a/docs/data-sources/notebook_paths.md +++ b/docs/data-sources/notebook_paths.md @@ -3,7 +3,7 @@ subcategory: "Workspace" --- # databricks_notebook_paths Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. This data source allows to list notebooks in the Databricks Workspace. diff --git a/docs/data-sources/schemas.md b/docs/data-sources/schemas.md index 07d9ab30a5..7e62a0c944 100644 --- a/docs/data-sources/schemas.md +++ b/docs/data-sources/schemas.md @@ -3,7 +3,7 @@ subcategory: "Unity Catalog" --- # databricks_schemas Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves a list of [databricks_schema](../resources/schema.md) ids, that were created by Terraform or manually, so that special handling could be applied. diff --git a/docs/data-sources/service_principal.md b/docs/data-sources/service_principal.md index 3b080f1e1c..b7b0e1fec4 100644 --- a/docs/data-sources/service_principal.md +++ b/docs/data-sources/service_principal.md @@ -4,7 +4,7 @@ subcategory: "Security" # databricks_service_principal Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves information about [databricks_service_principal](../resources/service_principal.md). diff --git a/docs/data-sources/service_principals.md b/docs/data-sources/service_principals.md index 4921be9690..a5fbe0e40c 100644 --- a/docs/data-sources/service_principals.md +++ b/docs/data-sources/service_principals.md @@ -4,7 +4,7 @@ subcategory: "Security" # databricks_service_principals Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves `application_ids` of all [databricks_service_principal](../resources/service_principal.md) based on their `display_name` diff --git a/docs/data-sources/spark_version.md b/docs/data-sources/spark_version.md index c5dfd84bbd..70fcef78f6 100644 --- a/docs/data-sources/spark_version.md +++ b/docs/data-sources/spark_version.md @@ -3,7 +3,7 @@ subcategory: "Compute" --- # databricks_spark_version Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Gets [Databricks Runtime (DBR)](https://docs.databricks.com/runtime/dbr.html) version that could be used for `spark_version` parameter in [databricks_cluster](../resources/cluster.md) and other resources that fits search criteria, like specific Spark or Scala version, ML or Genomics runtime, etc., similar to executing `databricks clusters spark-versions`, and filters it to return the latest version that matches criteria. Often used along [databricks_node_type](node_type.md) data source. diff --git a/docs/data-sources/sql_warehouse.md b/docs/data-sources/sql_warehouse.md index ac1d69e727..c65c5a7934 100644 --- a/docs/data-sources/sql_warehouse.md +++ b/docs/data-sources/sql_warehouse.md @@ -3,7 +3,7 @@ subcategory: "Databricks SQL" --- # databricks_sql_warehouse Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves information about a [databricks_sql_warehouse](../resources/sql_warehouse.md) using its id. This could be retrieved programmatically using [databricks_sql_warehouses](../data-sources/sql_warehouses.md) data source. diff --git a/docs/data-sources/sql_warehouses.md b/docs/data-sources/sql_warehouses.md index e8175c0019..cb6e578624 100644 --- a/docs/data-sources/sql_warehouses.md +++ b/docs/data-sources/sql_warehouses.md @@ -3,7 +3,7 @@ subcategory: "Databricks SQL" --- # databricks_sql_warehouses Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves a list of [databricks_sql_endpoint](../resources/sql_endpoint.md#id) ids, that were created by Terraform or manually. diff --git a/docs/data-sources/tables.md b/docs/data-sources/tables.md index 2117d8df6d..60b70f2249 100644 --- a/docs/data-sources/tables.md +++ b/docs/data-sources/tables.md @@ -3,7 +3,7 @@ subcategory: "Unity Catalog" --- # databricks_tables Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves a list of managed or external table full names in Unity Catalog, that were created by Terraform or manually. Use [databricks_views](views.md) for retrieving a list of views. diff --git a/docs/data-sources/user.md b/docs/data-sources/user.md index 92b4a58fe5..764c7b55bc 100644 --- a/docs/data-sources/user.md +++ b/docs/data-sources/user.md @@ -4,7 +4,7 @@ subcategory: "Security" # databricks_user Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves information about [databricks_user](../resources/user.md). diff --git a/docs/data-sources/views.md b/docs/data-sources/views.md index 42d1088d53..bc1cb696b1 100644 --- a/docs/data-sources/views.md +++ b/docs/data-sources/views.md @@ -3,7 +3,7 @@ subcategory: "Unity Catalog" --- # databricks_views Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. Retrieves a list of view full names in Unity Catalog, that were created by Terraform or manually. Use [databricks_tables](tables.md) for retrieving a list of tables. diff --git a/docs/data-sources/zones.md b/docs/data-sources/zones.md index 2013a06336..a4eebb29e9 100644 --- a/docs/data-sources/zones.md +++ b/docs/data-sources/zones.md @@ -3,7 +3,7 @@ subcategory: "Deployment" --- # databricks_zones Data Source --> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors. +-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _default auth: cannot configure default credentials_ errors. This data source allows you to fetch all available AWS availability zones on your workspace on AWS. diff --git a/docs/guides/aws-workspace.md b/docs/guides/aws-workspace.md index 1fe75e153c..a1ae58bfe4 100644 --- a/docs/guides/aws-workspace.md +++ b/docs/guides/aws-workspace.md @@ -285,7 +285,7 @@ output "databricks_token" { ### Data resources and Authentication is not configured errors -*In Terraform 0.13 and later*, data resources have the same dependency resolution behavior [as defined for managed resources](https://www.terraform.io/docs/language/resources/behavior.html#resource-dependencies). Most data resources make an API call to a workspace. If a workspace doesn't exist yet, `authentication is not configured for provider` error is raised. To work around this issue and guarantee a proper lazy authentication with data resources, you should add `depends_on = [databricks_mws_workspaces.this]` to the body. This issue doesn't occur if workspace is created *in one module* and resources [within the workspace](workspace-management.md) are created *in another*. We do not recommend using Terraform 0.12 and earlier, if your usage involves data resources. +*In Terraform 0.13 and later*, data resources have the same dependency resolution behavior [as defined for managed resources](https://www.terraform.io/docs/language/resources/behavior.html#resource-dependencies). Most data resources make an API call to a workspace. If a workspace doesn't exist yet, `default auth: cannot configure default credentials` error is raised. To work around this issue and guarantee a proper lazy authentication with data resources, you should add `depends_on = [databricks_mws_workspaces.this]` to the body. This issue doesn't occur if workspace is created *in one module* and resources [within the workspace](workspace-management.md) are created *in another*. We do not recommend using Terraform 0.12 and earlier, if your usage involves data resources. ```hcl data "databricks_current_user" "me" { diff --git a/docs/guides/azure-workspace.md b/docs/guides/azure-workspace.md index 8eef8e95a3..6660675b6a 100644 --- a/docs/guides/azure-workspace.md +++ b/docs/guides/azure-workspace.md @@ -68,7 +68,7 @@ output "databricks_host" { ### Data resources and Authentication is not configured errors -*In Terraform 0.13 and later*, data resources have the same dependency resolution behavior [as defined for managed resources](https://www.terraform.io/docs/language/resources/behavior.html#resource-dependencies). Most data resources make an API call to a workspace. If a workspace doesn't exist yet, `authentication is not configured for provider` error is raised. To work around this issue and guarantee a proper lazy authentication with data resources, you should add `depends_on = [azurerm_databricks_workspace.this]` to the body. This issue doesn't occur if workspace is created *in one module* and resources [within the workspace](workspace-management.md) are created *in another*. We do not recommend using Terraform 0.12 and earlier, if your usage involves data resources. +*In Terraform 0.13 and later*, data resources have the same dependency resolution behavior [as defined for managed resources](https://www.terraform.io/docs/language/resources/behavior.html#resource-dependencies). Most data resources make an API call to a workspace. If a workspace doesn't exist yet, `default auth: cannot configure default credentials` error is raised. To work around this issue and guarantee a proper lazy authentication with data resources, you should add `depends_on = [azurerm_databricks_workspace.this]` to the body. This issue doesn't occur if workspace is created *in one module* and resources [within the workspace](workspace-management.md) are created *in another*. We do not recommend using Terraform 0.12 and earlier, if your usage involves data resources. ```hcl data "databricks_current_user" "me" { diff --git a/docs/guides/gcp-workspace.md b/docs/guides/gcp-workspace.md index 2eaa10191c..1a28629a54 100644 --- a/docs/guides/gcp-workspace.md +++ b/docs/guides/gcp-workspace.md @@ -244,7 +244,7 @@ output "databricks_token" { ### Data resources and Authentication is not configured errors -*In Terraform 0.13 and later*, data resources have the same dependency resolution behavior [as defined for managed resources](https://www.terraform.io/docs/language/resources/behavior.html#resource-dependencies). Most data resources make an API call to a workspace. If a workspace doesn't exist yet, `authentication is not configured for provider` error is raised. To work around this issue and guarantee a proper lazy authentication with data resources, you should add `depends_on = [databricks_mws_workspaces.this]` to the body. This issue doesn't occur if workspace is created *in one module* and resources [within the workspace](workspace-management.md) are created *in another*. We do not recommend using Terraform 0.12 and earlier, if your usage involves data resources. +*In Terraform 0.13 and later*, data resources have the same dependency resolution behavior [as defined for managed resources](https://www.terraform.io/docs/language/resources/behavior.html#resource-dependencies). Most data resources make an API call to a workspace. If a workspace doesn't exist yet, `default auth: cannot configure default credentials` error is raised. To work around this issue and guarantee a proper lazy authentication with data resources, you should add `depends_on = [databricks_mws_workspaces.this]` to the body. This issue doesn't occur if workspace is created *in one module* and resources [within the workspace](workspace-management.md) are created *in another*. We do not recommend using Terraform 0.12 and earlier, if your usage involves data resources. ```hcl data "databricks_current_user" "me" { diff --git a/docs/guides/troubleshooting.md b/docs/guides/troubleshooting.md index 1849543904..9c85c9f689 100644 --- a/docs/guides/troubleshooting.md +++ b/docs/guides/troubleshooting.md @@ -22,7 +22,7 @@ TF_LOG=DEBUG DATABRICKS_DEBUG_TRUNCATE_BYTES=250000 terraform apply 2>&1 > tf-de ## Data resources and Authentication is not configured errors -*In Terraform 0.13 and later*, data resources have the same dependency resolution behavior [as defined for managed resources](https://www.terraform.io/docs/language/resources/behavior.html#resource-dependencies). Most data resources make an API call to a workspace. If a workspace doesn't exist yet, `authentication is not configured for provider` error is raised. To work around this issue and guarantee a proper lazy authentication with data resources, you should add `depends_on = [azurerm_databricks_workspace.this]` or `depends_on = [databricks_mws_workspaces.this]` to the body. This issue doesn't occur if workspace is created *in one module* and resources [within the workspace](guides/workspace-management.md) are created *in another*. We do not recommend using Terraform 0.12 and earlier, if your usage involves data resources. +*In Terraform 0.13 and later*, data resources have the same dependency resolution behavior [as defined for managed resources](https://www.terraform.io/docs/language/resources/behavior.html#resource-dependencies). Most data resources make an API call to a workspace. If a workspace doesn't exist yet, `default auth: cannot configure default credentials` error is raised. To work around this issue and guarantee a proper lazy authentication with data resources, you should add `depends_on = [azurerm_databricks_workspace.this]` or `depends_on = [databricks_mws_workspaces.this]` to the body. This issue doesn't occur if workspace is created *in one module* and resources [within the workspace](guides/workspace-management.md) are created *in another*. We do not recommend using Terraform 0.12 and earlier, if your usage involves data resources. ## Multiple Provider Configurations diff --git a/provider/provider_test.go b/provider/provider_test.go index 3ac9432c9e..8702566c32 100644 --- a/provider/provider_test.go +++ b/provider/provider_test.go @@ -91,7 +91,7 @@ func (tc providerFixture) apply(t *testing.T) { func TestConfig_NoParams(t *testing.T) { providerFixture{ - assertError: "authentication is not configured for provider", + assertError: "default auth: cannot configure default credentials", }.apply(t) } @@ -100,7 +100,7 @@ func TestConfig_HostEnv(t *testing.T) { env: map[string]string{ "DATABRICKS_HOST": "x", }, - assertError: "authentication is not configured for provider", + assertError: "default auth: cannot configure default credentials", }.apply(t) } @@ -109,7 +109,7 @@ func TestConfig_TokenEnv(t *testing.T) { env: map[string]string{ "DATABRICKS_TOKEN": "x", }, - assertError: "authentication is not configured for provider. Environment variables used: DATABRICKS_TOKEN", + assertError: "default auth: cannot configure default credentials. Config: token=***. Env: DATABRICKS_TOKEN", }.apply(t) } @@ -141,8 +141,8 @@ func TestConfig_UserPasswordEnv(t *testing.T) { "DATABRICKS_USERNAME": "x", "DATABRICKS_PASSWORD": "x", }, - assertError: "authentication is not configured for provider." + - " Environment variables used: DATABRICKS_USERNAME, DATABRICKS_PASSWORD", + assertError: "default auth: cannot configure default credentials. " + + "Config: username=x, password=***. Env: DATABRICKS_USERNAME, DATABRICKS_PASSWORD", assertHost: "https://x", }.apply(t) } @@ -213,7 +213,9 @@ func TestConfig_ConflictingEnvs(t *testing.T) { "DATABRICKS_USERNAME": "x", "DATABRICKS_PASSWORD": "x", }, - assertError: "More than one authorization method configured: password and token", + assertError: "validate: more than one authorization method configured: basic and pat. " + + "Config: host=x, token=***, username=x, password=***. " + + "Env: DATABRICKS_HOST, DATABRICKS_TOKEN, DATABRICKS_USERNAME, DATABRICKS_PASSWORD", }.apply(t) } @@ -236,7 +238,7 @@ func TestConfig_ConfigFile(t *testing.T) { env: map[string]string{ "CONFIG_FILE": "x", }, - assertError: "authentication is not configured for provider", + assertError: "default auth: cannot configure default credentials", }.apply(t) } @@ -258,8 +260,8 @@ func TestConfig_PatFromDatabricksCfg_NohostProfile(t *testing.T) { "HOME": "../common/testdata", "DATABRICKS_CONFIG_PROFILE": "nohost", }, - assertError: "cannot configure databricks-cli auth: config " + - "file ../common/testdata/.databrickscfg is corrupt: cannot find host in nohost profile", + assertError: "default auth: cannot configure default credentials. " + + "Config: token=***, profile=nohost. Env: DATABRICKS_CONFIG_PROFILE", }.apply(t) } @@ -270,7 +272,8 @@ func TestConfig_ConfigProfileAndToken(t *testing.T) { "DATABRICKS_CONFIG_PROFILE": "nohost", "HOME": "../common/testdata", }, - assertError: "More than one authorization method configured: config profile and token", + assertError: "default auth: cannot configure default credentials. " + + "Config: token=***, profile=nohost. Env: DATABRICKS_TOKEN, DATABRICKS_CONFIG_PROFILE", }.apply(t) } @@ -281,7 +284,8 @@ func TestConfig_ConfigProfileAndPassword(t *testing.T) { "DATABRICKS_CONFIG_PROFILE": "nohost", "HOME": "../common/testdata", }, - assertError: "More than one authorization method configured: config profile and password", + assertError: "validate: more than one authorization method configured: basic and pat. " + + "Config: token=***, username=x, profile=nohost. Env: DATABRICKS_USERNAME, DATABRICKS_CONFIG_PROFILE", }.apply(t) } @@ -341,7 +345,9 @@ func TestConfig_AzureCliHost_PatConflict(t *testing.T) { "PATH": p, "HOME": p, }, - assertError: "More than one authorization method configured: azure and token", + assertError: "validate: more than one authorization method configured: azure and pat. " + + "Config: host=https://dbc-XXXXXXXX-YYYY.cloud.databricks.com/, token=***, " + + "azure_workspace_resource_id=/subscriptions/a/resourceGroups/b/providers/Microsoft.Databricks/workspaces/c", }.apply(t) } @@ -373,7 +379,10 @@ func TestConfig_AzureAndPasswordConflict(t *testing.T) { "HOME": p, "DATABRICKS_USERNAME": "x", }, - assertError: "More than one authorization method configured: azure and password", + assertError: "validate: more than one authorization method configured: azure and basic and pat. " + + "Config: host=x, token=***, username=x, " + + "azure_workspace_resource_id=/subscriptions/a/resourceGroups/b/providers/Microsoft.Databricks/workspaces/c. " + + "Env: DATABRICKS_USERNAME", }.apply(t) } @@ -382,8 +391,7 @@ func TestConfig_CorruptConfig(t *testing.T) { env: map[string]string{ "HOME": "../common/testdata/corrupt", }, - assertError: "cannot configure databricks-cli auth: " + - "../common/testdata/corrupt/.databrickscfg has no DEFAULT profile configured", + assertError: "default auth: cannot configure default credentials", }.apply(t) }