mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 01:25:38 -05:00
Changes to getAccountSecurityToken (#11502)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user