mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-04 18:47:39 -05:00
Consolidate getSubscriptions (#16821)
* Consolidate getSubscriptions * Undo test change
This commit is contained in:
@@ -43,7 +43,7 @@ export class AzureResourceAccountTreeNode extends AzureResourceContainerTreeNode
|
||||
let subscriptions: azureResource.AzureResourceSubscription[] = [];
|
||||
|
||||
if (this._isClearingCache) {
|
||||
subscriptions = await this._subscriptionService.getAllSubscriptions(this.account);
|
||||
subscriptions = await this._subscriptionService.getSubscriptions(this.account);
|
||||
this.updateCache<azureResource.AzureResourceSubscription[]>(subscriptions);
|
||||
this._isClearingCache = false;
|
||||
} else {
|
||||
|
||||
@@ -118,7 +118,7 @@ async function getSubscriptionInfo(account: AzureAccount, subscriptionService: I
|
||||
total: number,
|
||||
selected: number
|
||||
}> {
|
||||
let subscriptions = await subscriptionService.getAllSubscriptions(account);
|
||||
let subscriptions = await subscriptionService.getSubscriptions(account);
|
||||
const total = subscriptions.length;
|
||||
let selected = total;
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import { AppContext } from '../../appContext';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { TokenCredentials } from '@azure/ms-rest-js';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { TreeNode } from '../treeNode';
|
||||
@@ -123,9 +122,7 @@ class ResourceLoader {
|
||||
|
||||
for (const account of accounts) {
|
||||
for (const tenant of account.properties.tenants) {
|
||||
const token = await azdata.accounts.getAccountSecurityToken(account, tenant.id, azdata.AzureResource.ResourceManagement);
|
||||
|
||||
for (const subscription of await this.subscriptionService.getSubscriptions(account, new TokenCredentials(token.token, token.tokenType), tenant.id)) {
|
||||
for (const subscription of await this.subscriptionService.getSubscriptions(account, [tenant.id])) {
|
||||
for (const providerId of await this.resourceService.listResourceProviderIds()) {
|
||||
for (const group of await this.resourceService.getRootChildren(providerId, account, subscription, subscription.tenant)) {
|
||||
const children = await this.resourceService.getChildren(providerId, group.resourceNode);
|
||||
|
||||
Reference in New Issue
Block a user