diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/credential/EnvironmentCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/credential/EnvironmentCredential.java index 3faceb97827ac..2c0bce8c72450 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/credential/EnvironmentCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/credential/EnvironmentCredential.java @@ -32,7 +32,7 @@ public EnvironmentCredential() { * @param identityClientOptions the options for configuring the identity client */ public EnvironmentCredential(IdentityClientOptions identityClientOptions) { - this.configuration = ConfigurationManager.getConfiguration(); + this.configuration = ConfigurationManager.getConfiguration().clone(); this.identityClientOptions = identityClientOptions; } @@ -42,7 +42,7 @@ public Mono getToken(String... scopes) { if (configuration.contains(BaseConfigurations.AZURE_CLIENT_ID) && configuration.contains(BaseConfigurations.AZURE_CLIENT_SECRET) && configuration.contains(BaseConfigurations.AZURE_TENANT_ID)) { - // TODO: support other clouds + // TODO: support other clouds. return new ClientSecretCredential(identityClientOptions) .clientId(configuration.get(BaseConfigurations.AZURE_CLIENT_ID)) .clientSecret(configuration.get(BaseConfigurations.AZURE_CLIENT_SECRET))