Skip to content

Commit bd4ac00

Browse files
andxuwangmingliang-ms
authored andcommitted
Fix bug 1905111:Sign in with Service Principal > Restart IDE > The account is auto signed out
1 parent d4ba0df commit bd4ac00

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Utils/azuretools-core/src/com/microsoft/azuretools/sdkmanage/IdentityAzureManager.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ public Mono<AuthMethodDetails> restoreSignIn(AuthMethodDetails authMethodDetails
153153
AuthConfiguration auth = new AuthConfiguration();
154154
auth.setType(AuthType.SERVICE_PRINCIPAL);
155155
auth.setClient(authMethodDetails.getClientId());
156-
auth.setTenant(authMethodDetails.getTenantId());
156+
if (CollectionUtils.isNotEmpty(authMethodDetails.getTenantIds())) {
157+
auth.setTenant(authMethodDetails.getTenantIds().get(0));
158+
} else {
159+
auth.setTenant(authMethodDetails.getTenantId());
160+
}
161+
157162
auth.setEnvironment(Azure.az(AzureCloud.class).get());
158163
if (StringUtils.isNotBlank(authMethodDetails.getCertificate())) {
159164
auth.setCertificate(authMethodDetails.getCertificate());

0 commit comments

Comments
 (0)