Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update environment variable property.
  • Loading branch information
aavasthy committed Aug 4, 2025
commit f2a80feaca90659b3ac2ad22e1c61e806be69104
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class Configs {
private static final String ADDRESS_REFRESH_RESPONSE_TIMEOUT_IN_SECONDS = "COSMOS.ADDRESS_REFRESH_RESPONSE_TIMEOUT_IN_SECONDS";

private static final String AAD_SCOPE_OVERRIDE = "COSMOS.AAD_SCOPE_OVERRIDE";
private static final String AAD_SCOPE_OVERRIDE_VARIABLE = "AZURE_COSMOS_AAD_SCOPE_OVERRIDE";
private static final String AAD_SCOPE_OVERRIDE_VARIABLE = "COSMOS_AAD_SCOPE_OVERRIDE";
private static final String DEFAULT_AAD_SCOPE_OVERRIDE = "";

public static final String NON_IDEMPOTENT_WRITE_RETRY_POLICY = "COSMOS.WRITE_RETRY_POLICY";
Expand Down Expand Up @@ -460,20 +460,6 @@ public int getGlobalEndpointManagerMaxInitializationTimeInSeconds() {
return getJVMConfigAsInt(GLOBAL_ENDPOINT_MANAGER_INITIALIZATION_TIME_IN_SECONDS, DEFAULT_GLOBAL_ENDPOINT_MANAGER_INITIALIZATION_TIME_IN_SECONDS);
}

public static String getAadScopeOverride() {
String valueFromSystemProperty = System.getProperty(AAD_SCOPE_OVERRIDE);
if (valueFromSystemProperty != null && !valueFromSystemProperty.isEmpty()) {
return valueFromSystemProperty;
}

String valueFromEnvVariable = System.getenv(AAD_SCOPE_OVERRIDE_VARIABLE);
if (valueFromEnvVariable != null && !valueFromEnvVariable.isEmpty()) {
return valueFromEnvVariable;
}

return DEFAULT_AAD_SCOPE_OVERRIDE;
}

public URI getThinclientEndpoint() {
String valueFromSystemProperty = System.getProperty(THINCLIENT_ENDPOINT);
if (valueFromSystemProperty != null && !valueFromSystemProperty.isEmpty()) {
Expand Down Expand Up @@ -1216,6 +1202,14 @@ public static boolean isReadAvailabilityStrategyEnabledWithPpaf() {
return Boolean.parseBoolean(isReadAvailabilityStrategyEnabledWithPpaf);
}

public static String getAadScopeOverride() {
return System.getProperty(
AAD_SCOPE_OVERRIDE,
firstNonNull(
emptyToNull(System.getenv().get(AAD_SCOPE_OVERRIDE_VARIABLE)),
DEFAULT_AAD_SCOPE_OVERRIDE));
}

public static int getWarnLevelLoggingThresholdForPpaf() {
String warnLevelLoggingThresholdForPpaf = System.getProperty(
WARN_LEVEL_LOGGING_THRESHOLD_FOR_PPAF,
Expand Down