You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pass --force-refresh to the Databricks CLI auth token command to bypass
the CLI's internal token cache. The SDK manages its own token caching,
so the CLI serving stale tokens from its cache causes unnecessary
refresh failures.
Commands are now tried in order: forceCmd (--profile + --force-refresh),
profileCmd (--profile), hostCmd (--host), falling back progressively
for older CLI versions that don't support newer flags.
Signed-off-by: Mihai Mitrea <mihai.mitrea@databricks.com>
Copy file name to clipboardExpand all lines: NEXT_CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
9
9
### New Features and Improvements
10
10
11
+
* Pass `--force-refresh` to Databricks CLI `auth token` command to bypass the CLI's internal token cache.
11
12
* Added `HostMetadataResolver` hook to allow callers to customize host metadata resolution, e.g. with caching ([#1572](https://github.com/databricks/databricks-sdk-go/pull/1572)).
12
13
* Added `NewLimitIterator` to `listing` package for lazy iteration with a cap on output items ([#1555](https://github.com/databricks/databricks-sdk-go/pull/1555)).
logger.Warnf(ctx, "Databricks CLI does not support --force-refresh flag. The CLI's token cache may provide stale tokens. Please upgrade your CLI to the latest version.")
100
+
}
101
+
102
+
ifc.profileCmd!=nil {
103
+
tok, err:=c.execCliCommand(ctx, c.profileCmd)
104
+
iferr==nil {
105
+
returntok, nil
106
+
}
107
+
if!isUnknownFlagError(err, "--profile") {
108
+
returnnil, err
109
+
}
86
110
logger.Warnf(ctx, "Databricks CLI does not support --profile flag. Falling back to --host. Please upgrade your CLI to the latest version.")
87
-
returnc.execCliCommand(ctx, c.hostCmd)
88
111
}
89
-
returntok, err
112
+
113
+
ifc.hostCmd==nil {
114
+
returnnil, fmt.Errorf("cannot get access token: no CLI commands available")
0 commit comments