mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-22 12:50:29 -04:00
Azure: add PostgresSQL support and refactor to use resource graph (#8046)
* Azure: add PostgresSQL support and refactor to use resource graph - Refactored to use @azure/arm-resourcegraph for all queries - Refactored database lookup to do just 2 queries (all servers, all DBS) instead of waiting serially on 1 query per RG - Added Azure Database for PostgresSQL Servers support in the tree - Removed use of older azure APIs in preference to ones compatible with resource graph - Note: Had to use v1.0 of new subscriptions package because resourcegraph is 2month out of date vs all other packages
This commit is contained in:
@@ -3,11 +3,9 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { Account } from 'azdata';
|
||||
import { ServiceClientCredentials } from 'ms-rest';
|
||||
import { SubscriptionClient } from 'azure-arm-resource';
|
||||
import { ServiceClientCredentials } from '@azure/ms-rest-js';
|
||||
import { SubscriptionClient } from '@azure/arm-subscriptions';
|
||||
|
||||
import { azureResource } from '../azure-resource';
|
||||
import { IAzureResourceSubscriptionService } from '../interfaces';
|
||||
@@ -16,7 +14,7 @@ export class AzureResourceSubscriptionService implements IAzureResourceSubscript
|
||||
public async getSubscriptions(account: Account, credential: ServiceClientCredentials): Promise<azureResource.AzureResourceSubscription[]> {
|
||||
const subscriptions: azureResource.AzureResourceSubscription[] = [];
|
||||
|
||||
const subClient = new SubscriptionClient.SubscriptionClient(credential);
|
||||
const subClient = new SubscriptionClient(credential);
|
||||
const subs = await subClient.subscriptions.list();
|
||||
subs.forEach((sub) => subscriptions.push({
|
||||
id: sub.subscriptionId,
|
||||
|
||||
Reference in New Issue
Block a user