mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Consolidate getSubscriptions (#16821)
* Consolidate getSubscriptions * Undo test change
This commit is contained in:
@@ -276,11 +276,7 @@ export async function getSubscriptions(appContext: AppContext, account?: azdata.
|
||||
const subscriptionService = appContext.getService<IAzureResourceSubscriptionService>(AzureResourceServiceNames.subscriptionService);
|
||||
await Promise.all(account.properties.tenants.map(async (tenant: { id: string; }) => {
|
||||
try {
|
||||
const response = await azdata.accounts.getAccountSecurityToken(account, tenant.id, azdata.AzureResource.ResourceManagement);
|
||||
const token = response.token;
|
||||
const tokenType = response.tokenType;
|
||||
|
||||
result.subscriptions.push(...await subscriptionService.getSubscriptions(account, new TokenCredentials(token, tokenType), tenant.id));
|
||||
result.subscriptions.push(...await subscriptionService.getSubscriptions(account, [tenant.id]));
|
||||
} catch (err) {
|
||||
const error = new Error(localize('azure.accounts.getSubscriptions.queryError', "Error fetching subscriptions for account {0} tenant {1} : {2}",
|
||||
account.displayInfo.displayName,
|
||||
|
||||
Reference in New Issue
Block a user