Skip to content

Commit 8370f46

Browse files
authored
Add disable instance discovery to DAC (Azure#34257)
1 parent df3d4e6 commit 8370f46

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

sdk/identity/azure-identity/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
### Bugs Fixed
1010
- Fixed detection logic for az/azd.
11+
- Add `disableInstanceDiscovery` to `DefaultAzureCredentialBuilder`
1112

1213
## 1.8.1 (2023-03-06)
1314

sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredentialBuilder.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,17 @@ public DefaultAzureCredentialBuilder additionallyAllowedTenants(List<String> add
218218
return this;
219219
}
220220

221+
/**
222+
* Disable instance discovery. Instance discovery is acquiring metadata about an authority from https://login.microsoft.com
223+
* to validate that authority. This may need to be disabled in private cloud or ADFS scenarios.
224+
*
225+
* @return An updated instance of this builder with instance discovery disabled.
226+
*/
227+
public DefaultAzureCredentialBuilder disableInstanceDiscovery() {
228+
this.identityClientOptions.disableInstanceDisovery();
229+
return this;
230+
}
231+
221232
/**
222233
* Creates new {@link DefaultAzureCredential} with the configured options set.
223234
*

0 commit comments

Comments
 (0)