Commit 36a1066
authored
Sync Azure environment resolution logic with Go SDK (#667)
## What changes are proposed in this pull request?
### Summary
Unified the Azure environment resolution logic between
`getAzureEnvironment()` and `getDatabricksEnvironment()` to ensure
consistent behavior and sync with the Go SDK implementation.
### Problem
Previously, `getAzureEnvironment()` and `getDatabricksEnvironment()` had
separate, independent logic for resolving Azure environments, which
could lead to inconsistent results:
- `getAzureEnvironment()` always defaulted to "PUBLIC" and directly
called `AzureEnvironment.getEnvironment()`
- `getDatabricksEnvironment()` had its own Azure environment matching
logic that was only triggered when `host == null`
This divergence meant that `config.getAzureEnvironment()` and
`config.getDatabricksEnvironment().getAzureEnvironment()` could return
different values for the same configuration.
### Changes
1. **Unified environment resolution**: `getAzureEnvironment()` now
delegates to `getDatabricksEnvironment().getAzureEnvironment()` instead
of maintaining separate logic
2. **Expanded Azure environment matching condition**: Updated
`getDatabricksEnvironment()` to trigger Azure environment matching when:
- `azureWorkspaceResourceId` is set AND
- Either `host` is null OR `azureEnvironment` is explicitly set
This allows users to explicitly override the environment even when a
host is configured.
3. **Updated test**: Modified
`DatabricksAuthManualTest.azureCliUserWithManagementAccess` to
explicitly set `azureEnvironment("PUBLIC")` to reflect the new unified
behavior.
## Testing
- All 1067 tests passing ✅
- Verified Azure CLI authentication works correctly with explicit
environment setting
- Confirmed consistent behavior between `getAzureEnvironment()` and
`getDatabricksEnvironment().getAzureEnvironment()`1 parent bc904c2 commit 36a1066
File tree
3 files changed
+8
-8
lines changed- databricks-sdk-java/src
- main/java/com/databricks/sdk/core
- test/java/com/databricks/sdk
3 files changed
+8
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
Lines changed: 5 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
| 535 | + | |
540 | 536 | | |
541 | 537 | | |
542 | 538 | | |
| |||
871 | 867 | | |
872 | 868 | | |
873 | 869 | | |
874 | | - | |
| 870 | + | |
| 871 | + | |
875 | 872 | | |
876 | | - | |
877 | | - | |
| 873 | + | |
| 874 | + | |
878 | 875 | | |
879 | 876 | | |
880 | 877 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
0 commit comments