use $CLI instead of databricks

This commit is contained in:
Shreyas Goenka 2025-03-03 19:31:41 +01:00
parent 1996d3f824
commit 88b6dc8e16
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
4 changed files with 13 additions and 13 deletions

View File

@ -1,11 +1,11 @@
>>> [CLI] bundle exec -- databricks current-user me
>>> [CLI] bundle exec -- [CLI] current-user me
{
"id":"[USERID]",
"userName":"[USERNAME]"
}
>>> [CLI] bundle exec --profile myprofile -- databricks current-user me
>>> [CLI] bundle exec --profile myprofile -- [CLI] current-user me
{
"id":"[USERID]",
"userName":"[USERNAME]"

View File

@ -8,7 +8,7 @@ unset DATABRICKS_HOST
unset DATABRICKS_TOKEN
# This should use the profile configured in the bundle, i.e. PAT auth
trace $CLI bundle exec -- databricks current-user me
trace $CLI bundle exec -- $CLI current-user me
# This should use myprofile, which uses oauth.
trace $CLI bundle exec --profile myprofile -- databricks current-user me
trace $CLI bundle exec --profile myprofile -- $CLI current-user me

View File

@ -1,23 +1,23 @@
>>> [CLI] bundle exec -- databricks current-user me
>>> [CLI] bundle exec -- [CLI] current-user me
{
"id":"[USERID]",
"userName":"[USERNAME]"
}
>>> [CLI] bundle exec -t pat -- databricks current-user me
>>> [CLI] bundle exec -t pat -- [CLI] current-user me
{
"id":"[USERID]",
"userName":"[USERNAME]"
}
>>> errcode [CLI] bundle exec -t pat -- databricks current-user me -t oauth
>>> errcode [CLI] bundle exec -t pat -- [CLI] current-user me -t oauth
Error: cannot resolve bundle auth configuration: validate: more than one authorization method configured: oauth and pat. Config: host=[DATABRICKS_URL], token=***, client_id=client_id, databricks_cli_path=[CLI]. Env: DATABRICKS_HOST, DATABRICKS_TOKEN, DATABRICKS_CLI_PATH
Error: Running "databricks current-user me -t oauth" failed with exit code: 1
Error: Running "[CLI] current-user me -t oauth" failed with exit code: 1
Exit code: 1
>>> [CLI] bundle exec -t oauth -- databricks current-user me
>>> [CLI] bundle exec -t oauth -- [CLI] current-user me
{
"id":"[USERID]",
"userName":"[USERNAME]"

View File

@ -1,15 +1,15 @@
# Default target
trace $CLI bundle exec -- databricks current-user me
trace $CLI bundle exec -- $CLI current-user me
# Explicitly select default target
trace $CLI bundle exec -t pat -- databricks current-user me
trace $CLI bundle exec -t pat -- $CLI current-user me
# Conflicting targets selected. This should fail because for the child command
# pat would be configured via environment variables and oauth via the CLI resulting
# in more than one authorization method configured.
trace errcode $CLI bundle exec -t pat -- databricks current-user me -t oauth
trace errcode $CLI bundle exec -t pat -- $CLI current-user me -t oauth
# Explicitly select oauth target
export DATABRICKS_TOKEN=""
export DATABRICKS_CLIENT_SECRET="client_secret"
trace $CLI bundle exec -t oauth -- databricks current-user me
trace $CLI bundle exec -t oauth -- $CLI current-user me