Azure core | Include alternate library accounts if found (#21565)

This commit is contained in:
Cheena Malhotra
2023-01-11 16:05:20 -08:00
committed by GitHub
parent 16740ba61f
commit 9708b470c7
3 changed files with 77 additions and 41 deletions

View File

@@ -17,7 +17,7 @@ import { AzureResourceServiceNames } from './constants';
import { AzureAccount, Tenant, azureResource } from 'azurecore';
import { FlatAccountTreeNode } from './tree/flatAccountTreeNode';
import { ConnectionDialogTreeProvider } from './tree/connectionDialogTreeProvider';
import { AzureResourceErrorMessageUtil } from './utils';
import { AzureResourceErrorMessageUtil, filterAccounts } from './utils';
export function registerAzureResourceCommands(appContext: AppContext, azureViewTree: AzureResourceTreeProvider, connectionDialogTree: ConnectionDialogTreeProvider, authLibrary: string): void {
const trees = [azureViewTree, connectionDialogTree];
@@ -33,7 +33,7 @@ export function registerAzureResourceCommands(appContext: AppContext, azureViewT
if (node instanceof AzureResourceAccountTreeNode) {
azureAccount = node.account;
} else {
let accounts = await azdata.accounts.getAllAccounts();
let accounts = filterAccounts(await azdata.accounts.getAllAccounts(), authLibrary);
accounts = accounts.filter(a => a.key.providerId.startsWith('azure'));
if (accounts.length === 0) {
const signin = localize('azure.signIn', "Sign in");