From 11452d04d4656f076ccbf8448325764da7414e28 Mon Sep 17 00:00:00 2001 From: Serge Smertin Date: Tue, 17 Oct 2023 13:13:16 +0200 Subject: [PATCH] Remove noisy `azure_workspace_resource_id field not provided` message for non-production Databricks deployments JWT mismatched claims errors are only happening for dev and staging deployments of Databricks, adding the unnecessary noise to production users. `azure_workspace_resource_id` is not required for authentication to succeed. --- databricks/sdk/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/databricks/sdk/core.py b/databricks/sdk/core.py index 84b700835..6e0d8c1cd 100644 --- a/databricks/sdk/core.py +++ b/databricks/sdk/core.py @@ -280,7 +280,8 @@ def for_resource(cfg: 'Config', resource: str) -> 'AzureCliTokenSource': return token except OSError: logger.warning("Failed to get token for subscription. Using resource only token.") - else: + elif cfg.effective_azure_login_app_id != ARM_DATABRICKS_RESOURCE_ID: + # the proper fix has to be done on Databricks Platform side logger.warning( "azure_workspace_resource_id field not provided. " + "It is recommended to specify this field in the Databricks configuration to avoid authentication errors."