From 3840856b4038b07f15575a9367dc237a19c957c9 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Tue, 18 Jul 2023 18:18:02 +0200 Subject: [PATCH] Add support for more SDK config options --- bundle/config/workspace.go | 20 ++++++++++++++++---- bundle/schema/docs/bundle_descriptions.json | 21 ++++++++++++++++----- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/bundle/config/workspace.go b/bundle/config/workspace.go index 1b6dc4cd5d..adbeae7c62 100644 --- a/bundle/config/workspace.go +++ b/bundle/config/workspace.go @@ -21,8 +21,14 @@ type Workspace struct { // // Generic attributes. - Host string `json:"host,omitempty"` - Profile string `json:"profile,omitempty"` + Host string `json:"host,omitempty"` + Profile string `json:"profile,omitempty"` + AuthType string `json:"auth_type,omitempty"` + ConfigFile string `json:"config_file,omitempty"` + MetadataServiceURL string `json:"metadata_service_url,omitempty"` + + // OAuth specific attributes. + ClientID string `json:"client_id,omitempty"` // Google specific attributes. GoogleServiceAccount string `json:"google_service_account,omitempty"` @@ -60,8 +66,14 @@ type Workspace struct { func (w *Workspace) Client() (*databricks.WorkspaceClient, error) { cfg := databricks.Config{ // Generic - Host: w.Host, - Profile: w.Profile, + Host: w.Host, + Profile: w.Profile, + AuthType: w.AuthType, + ConfigFile: w.ConfigFile, + MetadataServiceURL: w.MetadataServiceURL, + + // OAuth + ClientID: w.ClientID, // Google GoogleServiceAccount: w.GoogleServiceAccount, diff --git a/bundle/schema/docs/bundle_descriptions.json b/bundle/schema/docs/bundle_descriptions.json index 7734614eca..44f71ac306 100644 --- a/bundle/schema/docs/bundle_descriptions.json +++ b/bundle/schema/docs/bundle_descriptions.json @@ -1788,8 +1788,11 @@ "artifact_path": { "description": "The remote path to synchronize build artifacts to. This defaults to `${workspace.root}/artifacts`" }, + "auth_type": { + "description": "When multiple auth attributes are available in the environment, use the auth type specified by this argument", + }, "azure_client_id": { - "description": "" + "description": "Azure Client ID." }, "azure_environment": { "description": "Azure environment, one of (Public, UsGov, China, Germany)." @@ -1798,23 +1801,31 @@ "description": "Azure Login Application ID." }, "azure_tenant_id": { - "description": "" + "description": "Azure Tenant ID." }, "azure_use_msi": { - "description": "" + "description": "Whether to use Managed Service Identity (MSI) to authenticate to Azure Databricks." }, "azure_workspace_resource_id": { "description": "Azure Resource Manager ID for Azure Databricks workspace." }, + "client_id": { + "description": "OAath client ID for the Databricks workspace." + }, + "config_file": { + "description": "Path to the Databricks CLI configuration file. This defaults to `~/.databrickscfg`" + }, "file_path": { "description": "The remote path to synchronize local files artifacts to. This defaults to `${workspace.root}/files`" }, "google_service_account": { - "description": "" }, "host": { "description": "Host url of the workspace." }, + "metadata_service_url": { + "description": "The URL of the metadata service to use for authentication." + }, "profile": { "description": "Connection profile to use. By default profiles are specified in ~/.databrickscfg." }, @@ -3591,4 +3602,4 @@ } } } -} \ No newline at end of file +}