Changes to getAccountSecurityToken (#11502)

This commit is contained in:
Amir Omidi
2020-07-23 19:14:23 -07:00
committed by GitHub
parent 5b8039379e
commit eccf3cf5fe

View File

@@ -114,11 +114,11 @@ export async function getResourceGroups(appContext: AppContext, account?: azdata
return result;
}
const service = appContext.getService<AzureResourceGroupService>(AzureResourceServiceNames.resourceGroupService);
await Promise.all(account.properties.tenants.map(async (tenant: { id: string | number; }) => {
await Promise.all(account.properties.tenants.map(async (tenant: { id: string; }) => {
try {
const tokens = await azdata.accounts.getSecurityToken(account, azdata.AzureResource.ResourceManagement);
const token = tokens[tenant.id].token;
const tokenType = tokens[tenant.id].tokenType;
const tokenResponse = await azdata.accounts.getAccountSecurityToken(account, tenant.id, azdata.AzureResource.ResourceManagement);
const token = tokenResponse.token;
const tokenType = tokenResponse.tokenType;
result.resourceGroups.push(...await service.getResources(subscription, new TokenCredentials(token, tokenType), account));
} catch (err) {