File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
main/java/com/databricks/sdk/core
test/java/com/databricks/sdk Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -532,11 +532,7 @@ public DatabricksConfig setAzureTenantId(String azureTenantId) {
532532 }
533533
534534 public AzureEnvironment getAzureEnvironment () {
535- String env = "PUBLIC" ;
536- if (azureEnvironment != null ) {
537- env = azureEnvironment ;
538- }
539- return AzureEnvironment .getEnvironment (env );
535+ return getDatabricksEnvironment ().getAzureEnvironment ();
540536 }
541537
542538 public DatabricksConfig setAzureEnvironment (String azureEnvironment ) {
@@ -871,10 +867,11 @@ public DatabricksEnvironment getDatabricksEnvironment() {
871867 return this .databricksEnvironment ;
872868 }
873869
874- if (this .host == null && this .azureWorkspaceResourceId != null ) {
870+ if ((this .host == null || this .azureEnvironment != null )
871+ && this .azureWorkspaceResourceId != null ) {
875872 String azureEnv = "PUBLIC" ;
876- if (this .azureEnvironment != null ) {
877- azureEnv = this .azureEnvironment ;
873+ if (this .azureEnvironment != null && ! this . azureEnvironment . isEmpty () ) {
874+ azureEnv = this .azureEnvironment . toUpperCase () ;
878875 }
879876 for (DatabricksEnvironment env : DatabricksEnvironment .ALL_ENVIRONMENTS ) {
880877 if (env .getCloud () != Cloud .AZURE ) {
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ void azureCliUserWithManagementAccess() {
5050 createConfigWithMockClient ()
5151 .setAuthType ("azure-cli" )
5252 .setHost ("https://x" )
53+ .setAzureEnvironment ("PUBLIC" )
5354 .setAzureWorkspaceResourceId (azureWorkspaceResourceId );
5455 resolveConfig (config , env );
5556 Map <String , String > headers = config .authenticate ();
You can’t perform that action at this time.
0 commit comments