diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentitySyncClient.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentitySyncClient.java index bd09c0270eeec..93928adc969c8 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentitySyncClient.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/implementation/IdentitySyncClient.java @@ -361,9 +361,8 @@ public AccessToken authenticateWithAzureCli(TokenRequestContext request) { String tenant = IdentityUtil.resolveTenantId(tenantId, request, options); ValidationUtil.validateTenantIdCharacterRange(tenant, LOGGER); - if (!CoreUtils.isNullOrEmpty(tenant)) { + if (!CoreUtils.isNullOrEmpty(tenant) && !tenant.equals(IdentityUtil.DEFAULT_TENANT)) { azCommand.append(" --tenant ").append(tenant); - } try { @@ -410,7 +409,7 @@ public AccessToken authenticateWithAzureDeveloperCli(TokenRequestContext request String tenant = IdentityUtil.resolveTenantId(tenantId, request, options); ValidationUtil.validateTenantIdCharacterRange(tenant, LOGGER); - if (!CoreUtils.isNullOrEmpty(tenant)) { + if (!CoreUtils.isNullOrEmpty(tenant) && !tenant.equals(IdentityUtil.DEFAULT_TENANT)) { azdCommand.append(" --tenant-id ").append(tenant); }